Skip to content

gravo-lan/RSA-Encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Given a message, the program will encrypt it using an RSA algorithm. That is, the ASCII code of each char will be encrypted using the function c(m)=ce(mod(n)), where public n is the Carmichael Totient function (n) of two arbitrarily large prime numbers, p and q. When sending a message, the public key n and value of e are given, such that a receiver with the private key d would be able to easily decrypt the message using (ce)d, with m(c)=cd(mod(n)). d here is a private key - the modular multiplicative inverse of e, where public e is some 2<e<(n)gcd(e,(n))=1. The prime numbers p and q are generated randomly, while the Carmichael Totient function can be calculated by the product of p-1,q-1.

Each char, after encryption, will subsequently be concatenated into a full string, with a delimiter of ‘.’. The input of the program, for example, could be “Hello World!”. The output would be some “xxxxxxx.xxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxx…” etc. where the x’s represent numbers to be decrypted. The program will also output the public keys as well as the decrypted message.

Releases

No releases published

Packages

No packages published

Languages