Sharif University CTF 2016 - Smooth As Silk
Category: Crypto Points: 200 Solves: 11 Description:
p > q
n = p*q = 11461532818525251775869994369956628325437478510485272730419843320517940601808597552925629451795611990372651568770181872282590309894187815091191649914833274805419432525386234876477307472337026966745408507004000948112191973777090407558162018558945596691322909404307420094584606103206490426551745910268138393804043641876816598599064856358266650339178617149833032309379858059729179857419751093138295863034844253827963
flag = md5(str(p))
EN:
Can solve it by using Pollard P-1 Factorization Method(http://www.mersennewiki.org/index.php/P-1_Factorization_Method);

step 01:select B1
N =p*q (p>q)
q<=sqrt(N)
B1=sqrt(N)
more B1 is bigger, the more possible can find out it(?! maybe, No!)
step 02: count out E2, E3,E5 ....
2E2<=B1, 3E3<=B1 ...
E2=log(B1)/log(2)
E3=log(B1)/log(3)
E5=log(B1)/log(5)
E7=log(B1)/log(7)
...
push 2 in the z[] E2 times, push 3 in the z[] E3 times, push 5 in the z[] E5 times ...
step 03:
x=a, (a is a prime)
i=0
do
xz[i]≡a(mod n)
x=a
until gcd(n, x-1) !=1
gcd(n,x-1) is one factor of N.
#!/usr/bin/python3
import math n=11461532818525251775869994369956628325437478510485272730419843320517940601808597552925629451795611990372651568770181872282590309894187815091191649914833274805419432525386234876477307472337026966745408507004000948112191973777090407558162018558945596691322909404307420094584606103206490426551745910268138393804043641876816598599064856358266650339178617149833032309379858059729179857419751093138295863034844253827963
z=[]
prime=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
def gcd(a,b):
if b==0:
return a
return gcd(b,a%b) def e(a,b):
return pow(a,b)%n def mysqrt(n):
x=n
y=[]
while(x>0):
y.append(x%100)
x=x//100
y.reverse()
a=0
x=0
for p in y:
for b in range(9,-1,-1):
if(((20*a+b)*b)<=(x*100+p)):
x=x*100+p - ((20*a+b)*b)
a=a*10+b
break return a B1=mysqrt(n)
for j in range(0,len(prime)):
for i in range(1, int(math.log(B1)/math.log(prime[j]))+1):
z.append(prime[j]) #print(z) for pp in prime:
i=0
x=pp
while(1):
x=e(x,z[i])
i=i+1
y=gcd(n,x-1)
if(y!=1):
print (y)
exit(0)
if(i>=len(z)):
break
python3 sss.py, we can the number:
958483424448747472504060861580795018746355733561446016442794600533395417361061386707061258449029078376132360127073305093209304646989718030495000998517698501250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
then
n=11461532818525251775869994369956628325437478510485272730419843320517940601808597552925629451795611990372651568770181872282590309894187815091191649914833274805419432525386234876477307472337026966745408507004000948112191973777090407558162018558945596691322909404307420094584606103206490426551745910268138393804043641876816598599064856358266650339178617149833032309379858059729179857419751093138295863034844253827963
p=958483424448747472504060861580795018746355733561446016442794600533395417361061386707061258449029078376132360127073305093209304646989718030495000998517698501250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
q=11957987510443514049047696785587234758227153373363589891876816598599064856358266650339178617149833032309379858059729179857419751093138295863034844253827963
flag=md5(str(p)) = c78504a558bdb6213b9019f6925fa4ae
flag is c78504a558bdb6213b9019f6925fa4ae
CN:
这个是因子分解,用 Pollard P-1因子分解法(http://www.mersennewiki.org/index.php/P-1_Factorization_Method), pyhton3 源码看上面。
还是要看B1的选择,选择不好也是有可能解不出,解不出就重新选择,直到解出。
Sharif University CTF 2016 - Smooth As Silk的更多相关文章
- Sharif University CTF 2016 -- Login to System (PWN 200)
EN: It's easy to find out where is the bug : .text:0000000000400DE4 ; void *start_routine(void *).te ...
- Sharif University CTF 2016 -- Android App
很多种的方案: 方案 A: 直接逆向读代码方案 B: 解包,加入debug信息,重新打包,动态调试方案 C: 解包,改代码加入log.i整出flag, 去掉MainActivity里面d=什么也可以, ...
- H4CK1T CTF 2016 Mexico-Remote pentest writeup
进去网站之后发现连接都是包含类型的,就能想到文件包含漏洞(话说刚总结过就能遇到这题,也算是复习啦) 这里用php://filter/read=convert.base64-encode/resourc ...
- Asis CTF 2016 b00ks理解
---恢复内容开始--- 最近在学习堆的off by one,其中遇到这道题,萌新的我弄了大半天才搞懂,网上的很多wp都不是特别详细,都得自己好好调试. 首先,这题目是一个常见的图书馆管理系统,虽然我 ...
- 18. CTF综合靶机渗透(十一)
靶机描述: SkyDog Con CTF 2016 - Catch Me If You Can 难度:初学者/中级 说明:CTF是虚拟机,在虚拟箱中工作效果最好.下载OVA文件打开虚拟框,然后选择文件 ...
- 引言:CTF新世界
1. CTF的昨天和今天 CTF(Capture The Flag)中文一般译作夺旗赛,在网络安全领域中指的是网络安全技术人员之间进行技术竞技的一种比赛形式.CTF起源于1996年DEFCON全球黑客 ...
- {ICIP2014}{收录论文列表}
This article come from HEREARS-L1: Learning Tuesday 10:30–12:30; Oral Session; Room: Leonard de Vinc ...
- Pedestrian Attributes Recognition Paper List
Pedestrian Attributes Recognition Paper List 2018-12-22 22:08:55 [Note] you may also check the upda ...
- 文献综述十六:基于UML的中小型超市管理系统分析与设计
一.基本信息 标题:基于UML的中小型超市管理系统分析与设计 时间:2016 出版源:Journal of Xiangnan University 文件分类:uml技术系统的研究 二.研究背景 开发一 ...
随机推荐
- linux基础学习
1.默认不写端口号的就是80端口 本地ip:localhost或者127.0.0.1 2.用户管理 id和whoami:可以查看当前用户 who和w查看当前已经登录的用户 (1)添加用户,用户默认的家 ...
- AS快捷键
Ctrl+Q 显示关键字的提示文档 Ctrl+鼠标点击 查看关键字的源码 ctrl+T 在不同的选项卡中进行切换 ctrl+J 提示当前位置输入模板 Ctrl+P 提示参数 Alt+Enter 提示 ...
- C++ vector erase函数的使用注意事项
最近使用了顺序容器的删除元素操作,特此记录下该函数的注意事项. 在C++primer中对c.erase(p) 这样解释的: c.erase(p) 删除迭代器p所指向的元素,返回一个指向被删元素 ...
- Oracle基础笔记
=====================================第一章:oracle数据库基础============================================= Or ...
- zz Must read
http://www.opengpu.org/forum.php?mod=viewthread&tid=965&extra=page%3D1 游戏引擎剖析(Game Engine An ...
- Mono 异步加载数据更新主线程
主要是用 async和 await 调用 RunOnUiThread来更新. 调用函数: //异步加载数据开始 doInBackground (); //异步加载数据开始end protected a ...
- win7双系统安装ubuntu并配置常用软件
首先在win7下磁盘清理出来空间具体方法找度娘就行了. 下面开始准备安装: 1.下载easyBCD 2.打开:添加新条目--NeoGub--安装 3.点击配置 修改menu.lst title In ...
- 数据回复之TestDisk的使用
1,选择[No Log]或者是[Create]进入 2.选择好要恢复的硬盘,回车 3.选择Intel或者其他的系统,大多数选择intel(windows)使用,回车确认 4.选择[Analyse](分 ...
- oracle 查询执行过的SQL语句
SELECT * FROM v$sqlarea t WHERE t.FIRST_LOAD_TIME between '2016-12-23/16:03:00' and '2016-12-23/16:0 ...
- This kind of launch is configured to open the Debug perspective when it suspends.
This kind of launch is configured to open the Debug perspective when it suspends. 因为设置了断点才会弹出这个,不需要调 ...