BUUCTF题目Crypto部分wp(持续更新)

Url编码

题目密文是%66%6c%61%67%7b%61%6e%64%20%31%3d%31%7d,根据题目名字使用python的urllib模块解码即可。flag{and 1=1}

from urllib.parse import quote, unquote

c = r'%66%6c%61%67%7b%61%6e%64%20%31%3d%31%7d'
m = unquote(c, encoding='utf-8')
print(m)

c2 = quote(m, encoding='utf-8')
print(c2)

Quoted-printable

题目密文是=E9=82=A3=E4=BD=A0=E4=B9=9F=E5=BE=88=E6=A3=92=E5=93=A6,根据题目名字使用python的quopri模块解码即可。flag{那你也很棒哦}

import quopri

c = '=E9=82=A3=E4=BD=A0=E4=B9=9F=E5=BE=88=E6=A3=92=E5=93=A6'
m = quopri.decodestring(c.encode('utf-8')).decode('utf-8')
print(m)

c2 = quopri.encodestring(m.encode('utf-8')).decode('utf-8')
print(c2)

Alice与Bob

下面是一个大整数:98554799767,请分解为两个素数,分解后,小的放前面,大的放后面,合成一个新的数字,进行md5的32位小写哈希,提交答案。提交flag{d450209323a847c8d01c6be47c81811a}

import hashlib
import binascii

# 用yafu factor(98554799767)分解得到f1和f2
f = 98554799767
f1 = 101999
f2 = 966233
s = str(f1) + str(f2)

m = hashlib.md5()
m.update(s.encode('utf-8'))
ba = m.digest()
print(ba)
hex_str = binascii.b2a_hex(ba)
print(hex_str)

Next

你可能感兴趣的:(信息安全,#,BUUCTF,CTF,Crypto,密码学)