题目:
我给你的情书,请收好。
Premise: Enumerate the alphabet by 0、1、2、… 、25
Using the RSA system
Encryption:0156 0821 1616 0041 0140 2130 1616 0793
Public Key:2537 and 13
Private Key:2537 and 937
flag: wctf2020{Decryption}
根据题目,使用了RSA的加密系统
那么我们可以得到
N = 2537 #分解得p、q
e = 13
d = 937
p = 43
q = 59
解密思路:按照RSA思路解出密文,再转成字母
a = "abcdefghijklmnopqrstuvwxyz"
c = "0156 0821 1616 0041 0140 2130 1616 0793".split(" ")
N = 2537
e = 13
d = 937
p = 43
q = 59
phi_N = (p-1)*(q-1)
m = "".join(a[pow(int(i),d,N)] for i in c)
print (m)
文章评论