diff --git a/Crypto/RSA_Baby/encrypt.py b/Crypto/RSA_Baby/encrypt.py index afead45..655d015 100644 --- a/Crypto/RSA_Baby/encrypt.py +++ b/Crypto/RSA_Baby/encrypt.py @@ -3,8 +3,10 @@ import gmpy2 import os +# Import original flag flag = open("flag.txt",'r') +# Generating Prime p = getPrime(512) q = 9896984395151566492448748862139262345387297785144637332499966426571398040295087125558780121504834847289828037371643927199404615218623314326851473129699891 n = p*q @@ -12,6 +14,7 @@ phi = (p-1)*(q-1) d = gmpy2.invert(e,phi) +# Encrypting Messages message = bytes_to_long(flag.read()) ciphertext = pow(message,e,n)