Skip to content

not-a-dogOK/encryption-and-decryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSA:

This Python file contains a simple implementation of the RSA encryption and decryption algorithm.

Encryption:

The encryption formula used is:

{\displaystyle {\boldsymbol {c=m^{e}{\mbox{ mod }}n}}}

where m is the plaintext message, e is a randomly generated co-prime integer to n, and n is the product of two large prime numbers, p and q.

Decryption:

The decryption formula used is:

{\displaystyle \ {\boldsymbol {m=c^{d}{\mbox{ mod }}n}}}

where c is the encrypted message, d is the private key generated using p and q and e, and n is the product of the same two prime numbers used for encryption.