본문 바로가기
# technic/- reversing

[python] RSA - chiper text decoe

by ddddh 2017. 4. 20.

python을 사용한 RSA chiper text decode 하기.





1
2
3
4
5
6
7
8
9
10
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA
from base64 import b64decode
 
rsa_key = RSA.importKey(open('private.txt'"rb").read())
verifier = PKCS1_v1_5.new(rsa_key)
raw_cipher_data = b64decode("chiper_text")
phn = rsa_key.decrypt(raw_cipher_data)
print phn
cs