buuoj crypto

crypto分类部分题解

MD5

题目给了md5值,查彩虹表得到flag
https://cmd5.com

看我回旋踢

{}字符位置没变,凯撒密码,位移量13
https://www.qqxiuzi.cn/bianma/kaisamima.php

Url编码

如题目,UrlDecode得到flag
http://tool.chinaz.com/tools/urlencode.aspx

一眼就解密

base64解码
http://tool.chinaz.com/tools/base64.aspx

摩丝

摩斯密码(mdzz注意要提交大写字母)
http://moersima.00cha.net

变异凯撒

根据flag{}的格式,可以判断位移量是递增的

x='afZ_r9VYfScOeO_UL^RWUc'
ans=''
i=5
for s in x:
    ans+=chr(ord(s)+i)
    i=i+1
print(ans)

password

姓名:张三
生日:19900315

key格式为key{xxxxxxxxxx}
zs19900315长度刚好够

Quoted-printable

import urllib.parse
x='=E9=82=A3=E4=BD=A0=E4=B9=9F=E5=BE=88=E6=A3=92=E5=93=A6'#密文
ans=''
for s in x:
    if s=='=':
        ans+='%'
    else:
        ans+=s
print(urllib.parse.unquote(ans))

zip伪加密

winhex修改加密标志位
https://blog.csdn.net/qq_34072526/article/details/87205396

Rabbit

https://www.sojson.com/encrypt_rabbit.html
https://blog.csdn.net/myspacedemen/article/details/51433426

RSA

RSA:
https://www.jianshu.com/p/fbb8bf7baa97
扩展欧几里得算法:
https://blog.csdn.net/destiny1507/article/details/81750874

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

篱笆墙的影子

栅栏密码,分13栏
https://www.qqxiuzi.cn/bianma/zhalanmima.php

丢失的MD5

下载下来是个python脚本

import hashlib
for i in range(32,127):
    for j in range(32,127):
        for k in range(32,127):
            m = hashlib.md5()
			m.update('TASC'+chr(i)+'O3RJMV'+chr(j)+'WDJKX'+chr(k)+'ZM')
            des = m.hexdigest()
            if 'e9032' in des and 'da' in des and '911513' in des:
                print des

因为我安装的是python3.8,所以不能直接运行,给update的字符串加上encode('utf-8'),print函数加上括号,执行之后加上flag{}提交即可

Alice与Bob

数比较小,直接循环算

x = 98554799767
i = 2
while i < pow(x, 0.5):
    if x % i == 0:
        print(i)
        print(x/i)
        break
    i = i + 1

[BJDCTF 2nd]老文盲了

罼雧締眔擴灝淛匶襫黼瀬鎶軄鶛驕鳓哵眔鞹鰝

吐了,原来是拼音

淛匶襫黼瀬鎶軄鶛驕鳓哵

rsarsa

惊了,这么大的数,求幂居然能直接算??!

p = 9648423029010515676590551740010426534945737639235739800643989352039852507298491399561035009163427050370107570733633350911691280297777160200625281665378483
q = 11874843837980297032092405848653656852760910154543380907650040190704283358909208578251063047732443992230647903887510065547947313543299303261986053486569407
e = 65537
c = 83208298995174604174773590298203639360540024871256126892889661345742403314929861939100492666605647316646576486526217457006376842280869728581726746401583705899941768214138742259689334840735633553053887641847651173776251820293087212885670180367406807406765923638973161375817392737747832762751690104423869019034
d = pow(e, -1, (p-1)*(q-1))
print(pow(c, d, p*q))
原创文章 10 获赞 1 访问量 319

猜你喜欢

转载自blog.csdn.net/qq_43871200/article/details/105469784