Skip to content

Instantly share code, notes, and snippets.

@rizwansoaib
Created March 15, 2018 18:29
Show Gist options
  • Save rizwansoaib/56a5230386e8210058b727bfc441a421 to your computer and use it in GitHub Desktop.
Save rizwansoaib/56a5230386e8210058b727bfc441a421 to your computer and use it in GitHub Desktop.
def encrypt(pt):
ct=pow(pt,13)
ct=ct%667
print("\nYour Encrypt Data is:",ct)
def decrypt(ct):
pt=pow(ct,237)
pt=pt%667
print("\nYour Decrypt Data is:",pt)
print("Enter choice:\n1- Encryption\n2- Decryption\n")
x=int(input())
if(x==1):
print("\nPlease enter Data to Encrypt them\n")
num=int(input())
encrypt(num)
if(x==2):
print("\nPlease enter number to Decrypt them\n")
num=int(input())
decrypt(num)
print("\nDo You Want to Check it Enter 1:")
y=int(input())
if(y==1):
print("\nPlease enter number to Dncrypt them\n")
num=int(input())
decrypt(num)
@rizwansoaib
Copy link
Author

Encrypt data upto 667 decimal number
RSA ALGORITHM

@subahanii
Copy link

Great!

Bro ...is it encrypt only one number?

What I do for encrypt a sentence or word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment