区块链技术博客
www.b2bchain.cn

BUUCTF-crypto(1-29)

这篇文章主要介绍了BUUCTF-crypto(1-29)的讲解,通过具体代码实例进行16836 讲解,并且分析了BUUCTF-crypto(1-29)的详细步骤与相关技巧,需要的朋友可以参考下https://www.b2bchain.cn/?p=16836

本文实例讲述了2、树莓派设置连接WiFi,开启VNC等等的讲解。分享给大家供大家参考文章查询地址https://www.b2bchain.cn/7039.html。具体如下:

这里写目录标题

  • BUUCTF-crypto(1-1)
  • MD5
  • Url编码
  • 一眼就解密
  • 看我回旋踢
  • 摩丝
  • [BJDCTF 2nd]签到-y1ng
  • password
  • 变异凯撒
  • Quoted-printable
  • Rabbit
  • 篱笆墙的影子
  • RSA
  • 丢失的MD5
  • [BJDCTF 2nd]老文盲了
  • Alice与Bob
  • rsarsa
  • 大帝的密码武器
  • Windows系统密码
  • [BJDCTF 2nd]cat_flag
  • [BJDCTF 2nd]燕言燕语-y1ng
  • 传统知识+古典密码
  • [GKCTF2020]小学生的密码学
  • 信息化时代的步伐
  • RSA1
  • old-fashion
  • [BJDCTF 2nd]灵能精通-y1ng
  • 权限获得第一步
  • 萌萌哒的八戒
  • RSA
  • RSA2
  • RSA3
  • [BJDCTF 2nd]Y1nglish-y1ng
  • 世上无难事
  • 异性相吸
  • 还原大师
  • [GKCTF2020]汉字的秘密

BUUCTF-crypto(1-1)

MD5

BUUCTF-crypto(1-29)

Url编码

BUUCTF-crypto(1-29)

一眼就解密

BUUCTF-crypto(1-29)

看我回旋踢

BUUCTF-crypto(1-29)

摩丝

BUUCTF-crypto(1-29)

[BJDCTF 2nd]签到-y1ng

BUUCTF-crypto(1-29)

password

弱口令密码拼凑
BUUCTF-crypto(1-29)

变异凯撒

afZ_r ascii 97 102 90 95 114

flag{ ascii 102 108 97 103 123

ascii相差规律,5 6 7 8 9
脚本:

s = "afZ_r9VYfScOeO_UL^RWUc" re = "" a = 5 for i in s :     re +=chr(ord(i)+a)     a +=1 print(re) 

BUUCTF-crypto(1-29)

Quoted-printable

BUUCTF-crypto(1-29)

Rabbit

BUUCTF-crypto(1-29)

篱笆墙的影子

栅栏密码
BUUCTF-crypto(1-29)

RSA

已知p,q,e求d
脚本附上:

import gmpy2  p=473398607161 q=4511491 e=17  gmpy2.mpz(p) gmpy2.mpz(q) n = (p-1)*(q-1) d = gmpy2.invert(e,n) print(d)  

BUUCTF-crypto(1-29)

丢失的MD5

运行脚本即可得到flag
BUUCTF-crypto(1-29)

[BJDCTF 2nd]老文盲了

奇怪的知识又增加了~
罼雧締眔擴灝淛匶襫黼瀬鎶軄鶛驕鳓哵眔鞹鰝

附上别的师傅的wp.

Alice与Bob

基于大素数分解,解码网站.
BUUCTF-crypto(1-29)
BUUCTF-crypto(1-29)

flag{d450209323a847c8d01c6be47c81811a}

rsarsa

已知p,q,e,c求m
脚本:

import gmpy2  p=9648423029010515676590551740010426534945737639235739800643989352039852507298491399561035009163427050370107570733633350911691280297777160200625281665378483 q=11874843837980297032092405848653656852760910154543380907650040190704283358909208578251063047732443992230647903887510065547947313543299303261986053486569407 e=65537 c=83208298995174604174773590298203639360540024871256126892889661345742403314929861939100492666605647316646576486526217457006376842280869728581726746401583705899941768214138742259689334840735633553053887641847651173776251820293087212885670180367406807406765923638973161375817392737747832762751690104423869019034  gmpy2.mpz(p) gmpy2.mpz(q) n = (p-1)*(q-1) d = gmpy2.invert(e,n) N=p*q m=gmpy2.powmod(c,d,N) flag=str(m) print("flag{"+flag+"}") 

BUUCTF-crypto(1-29)

大帝的密码武器

凯撒大帝,发现可以组成一个单词
BUUCTF-crypto(1-29)

向量为13,加密密文:ComeChina

BUUCTF-crypto(1-29)

P换为大写

Windows系统密码

拿ctf用户的hash进行md5解密,第二段解密成功
BUUCTF-crypto(1-29)

BUUCTF-crypto(1-29)

[BJDCTF 2nd]cat_flag

参考其他师傅的WP

[BJDCTF 2nd]燕言燕语-y1ng

十六进制转换字符,在进行维吉尼亚解密
BUUCTF-crypto(1-29)

BUUCTF-crypto(1-29)

传统知识+古典密码

参考其他师傅的WP

[GKCTF2020]小学生的密码学

BUUCTF-crypto(1-29)

信息化时代的步伐

参考其他师傅的WP

RSA1

已知p,q,dp,dq,c求m
脚本:

import gmpy2 import binascii def decrypt(dp,dq,p,q,c):         InvQ = gmpy2.invert(q,p)         mp = pow(c,dp,p)         mq = pow(c,dq,q)         m=(((mp-mq)*InvQ)%p)*q+mq         temp_flag=binascii.unhexlify(hex(m)[2:])         print(temp_flag) p = 8637633767257008567099653486541091171320491509433615447539162437911244175885667806398411790524083553445158113502227745206205327690939504032994699902053229  q = 12640674973996472769176047937170883420927050821480010581593137135372473880595613737337630629752577346147039284030082593490776630572584959954205336880228469  dp = 6500795702216834621109042351193261530650043841056252930930949663358625016881832840728066026150264693076109354874099841380454881716097778307268116910582929  dq = 783472263673553449019532580386470672380574033551303889137911760438881683674556098098256795673512201963002175438762767516968043599582527539160811120550041  c = 24722305403887382073567316467649080662631552905960229399079107995602154418176056335800638887527614164073530437657085079676157350205351945222989351316076486573599576041978339872265925062764318536089007310270278526159678937431903862892400747915525118983959970607934142974736675784325993445942031372107342103852  decrypt(dp,dq,p,q,c)  

BUUCTF-crypto(1-29)

某一次比赛中以为是凯撒,但是解不出,赛后看其他队的wp才知道是quipqiup.
BUUCTF-crypto(1-29)
转为小写去掉空格再提交
BUUCTF-crypto(1-29)

old-fashion

还是词频分析
BUUCTF-crypto(1-29)

[BJDCTF 2nd]灵能精通-y1ng

flag{IMKNIGHTSTEMPLAR}
BUUCTF-crypto(1-29)

权限获得第一步

BUUCTF-crypto(1-29)

萌萌哒的八戒

BUUCTF-crypto(1-29)

RSA

从pub.key中提取n,e
BUUCTF-crypto(1-29)
得到n去提取p,q,网站:http://www.factordb.com/
BUUCTF-crypto(1-29)

得到p,q,n,e求d以及解密flag文件
p=285960468890451637935629440372639283459
q=304008741604601924494328155975272418463
e=65537
n=8693448229604811919066606200349480058890565601720302561721665405
8378322103517

脚本:

import gmpy2 import rsa  e = 65537 n = 86934482296048119190666062003494800588905656017203025617216654058378322103517 p = 285960468890451637935629440372639283459 q = 304008741604601924494328155975272418463  phin = (q-1)*(p-1) d = gmpy2.invert(e, phin)  key = rsa.PrivateKey(n, e, int(d), p, q)  with open("flag.enc", "rb+") as f:     f = f.read()     print(rsa.decrypt(f, key))  

BUUCTF-crypto(1-29)

RSA2

参考.

e = 65537
n = 248254007851526241177721526698901802985832766176221609612258877371620580060433101538328030305219918697643619814200930679612109885533801335348445023751670478437073055544724280684733298051599167660303645183146161497485358633681492129668802402065797789905550489547645118787266601929429724133167768465309665906113
dp = 905074498052346904643025132879518330691925174573054004621877253318682675055421970943552016695528560364834446303196939207056642927148093290374440210503657

c = 140423670976252696807533673586209400575664282100684119784203527124521188996403826597436883766041879067494280957410201958935737360380801845453829293997433414188838725751796261702622028587211560353362847191060306578510511380965162133472698713063592621028959167072781482562673683090590521214218071160287665180751

脚本:

import gmpy2 as gp  e = 65537 n = 248254007851526241177721526698901802985832766176221609612258877371620580060433101538328030305219918697643619814200930679612109885533801335348445023751670478437073055544724280684733298051599167660303645183146161497485358633681492129668802402065797789905550489547645118787266601929429724133167768465309665906113 dp = 905074498052346904643025132879518330691925174573054004621877253318682675055421970943552016695528560364834446303196939207056642927148093290374440210503657  c = 140423670976252696807533673586209400575664282100684119784203527124521188996403826597436883766041879067494280957410201958935737360380801845453829293997433414188838725751796261702622028587211560353362847191060306578510511380965162133472698713063592621028959167072781482562673683090590521214218071160287665180751   for i in range(1,e):                   #在范围(1,e)之间进行遍历     if(dp*e-1)%i == 0:         if n%(((dp*e-1)//i)+1) == 0:   #存在p,使得n能被p整除             p=((dp*e-1)//i)+1             q=n//(((dp*e-1)//i)+1)             phi=(q-1)*(p-1)            #欧拉定理             d=gp.invert(e,phi)         #求模逆             m=pow(c,d,n)               #快速求幂取模运算             print(m)                               #10进制明文 print('------------') print(hex(m)[2:])                      #16进制明文 print('------------') print(bytes.fromhex(hex(m)[2:]))       #16进制转文本  

BUUCTF-crypto(1-29)

RSA3

参考

[BJDCTF 2nd]Y1nglish-y1ng

也是词频分析
BUUCTF-crypto(1-29)
BJD{pyth0n_Brut3_f0rc3_oR_quipquip_AI_Cr4cy}把最后一个y改为k

世上无难事

还是词频分析
BUUCTF-crypto(1-29)
转为小写
BUUCTF-crypto(1-29)

异性相吸

异或字符
脚本:

with open('密文.txt' )as a:     a=a.read() with open('key.txt' )as b:     b=b.read() d='' for i in range(0,len(b)):     c=chr(ord(a[i])^ord(b[i]))     d+=c print(d)  

BUUCTF-crypto(1-29)

还原大师

# -*- coding: utf-8 -*- #!/usr/bin/env python import hashlib  #print hashlib.md5(s).hexdigest().upper() k = 'TASC?O3RJMV?WDJKX?ZM' for i in range(26): 	temp1 = k.replace('?',str(chr(65+i)),1) 	for j in range(26): 		temp2 = temp1.replace('?',chr(65+j),1) 		for n in range(26): 			temp3 = temp2.replace('?',chr(65+n),1) 			s = hashlib.md5(temp3.encode('utf8')).hexdigest().upper() 			if s[:4] == 'E903': 				print (s) 

BUUCTF-crypto(1-29)

[GKCTF2020]汉字的秘密

当铺密码 [1] 就是一种将中文和数字进行转化的密码,算法相当简单:当前汉字有多少笔画出头,就是转化成数字几。例如:
王夫 井工 夫口 由中人 井中 夫夫 由中大:67 84 70 123 82 77 125

脚本:

dh = '田口由中人工大土士王夫井羊壮' ds = '00123455567899'  cip = '王壮 夫工 王中 王夫 由由井 井人 夫中 夫夫 井王 土土 夫由 土夫 井中 士夫 王工 王人 土由 由口夫' s = '' for i in cip: 	if i in dh: 		s += ds[dh.index(i)] 	else: 		s += ' ' #print(s)  ll = s.split(" ") t = '' for i in range(0,len(ll)): 	t += chr(int(ll[i])+i+1) print('t=', t, 'ttt.lower()=', t.lower()) 

BUUCTF-crypto(1-29)

本文转自互联网,侵权联系删除BUUCTF-crypto(1-29)

赞(0) 打赏
部分文章转自网络,侵权联系删除b2bchain区块链学习技术社区 » BUUCTF-crypto(1-29)
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

b2b链

联系我们联系我们