Skip to content

AdilRabbani/RSA-Encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

RSA-Encryption

Example

RSA Encryption in C++

  1. The program first calculates two random prime numbers p and q
  2. n is calculated as n = p * q
  3. phi is as calculated as phi = (p - 1) * (q - 1)
  4. modular multiplicative inverse d is calculated as e * d % phi = 1
  5. The message is then encrypted as C(M) = M^e % n
  6. The message can then be decrypted using M(C) = C^d % n
    Note that only alphabets (lowercase or uppercase) and spaces can be used in a message to be encrypted/decrypted.
    Other characters may give unexpected results.

About

RSA Encryption in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages