rsa解密
给了flag.en和rsa_private_key.pem私钥,直接用openssl解密,得到flag{We1c0meCtf3r_elab}
也可用python解密:
import rsa
def decrypt(crypt_text): # 用私钥解密
with open('rsa_private_key.pem', 'rb') as privatefile:
p = privatefile.read()
privkey = rsa.PrivateKey.load_pkcs1(p)
lase_text = rsa.decrypt(crypt_text, privkey).decode()
print(lase_text)
if __name__ == '__main__':
with open('flag.en', 'rb') as publickfile:
p = publickfile.read()
lase_text = decrypt(p)