Skip to content

RSA(Rivest-Shamir-Adleman) cryptosystem is widely used for secure communication such as credit card machines, phones, ATM machines and operating systems. It uses a random prime number and public-key to encrypt and decrypt information.

Notifications You must be signed in to change notification settings

jongsoo1203/RSA-Cryptosystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RSA-Cryptosystem

The RSA (Rivest-Shamir-Adleman) cryptosystem is widely used for secure communication in browsers, bank ATM machines, credit card machines, mobile phones, smart cards, and operating systems. It works by manipulating integers. To thwart eavesdroppers, the RSA cryptosystem must manipulate huge integers (hundreds of digits), which is naturally supported by the int data type in Python. Your task is to implement a library that supports core functions needed for developing the RSA cryptosystem and implement programs for encrypting and decrypting messages using RSA.

RSA.py

The RSA public-key cryptosystem involves three integers n, e, and d that satisfy certain mathematical properties. The public key (n; e) is made public on the Internet, while the private key (n; d) is only known to Bob. If Alice wants to send Bob a message, she encrypts it using the function E(x) = y = x^e mod n; Decrypts by D(y) = y^d mod n;

Keygen.py

accepts lo (int) and hi (int) as command-line arguments, generates public/private keys (n; e; d), and writes the keys to standard output, separated by a space.

encrypt.py

accepts the public-key n (int) and e (int) as command-line arguments and a message to encrypt from standard input, encrypts each character in the message, and writes its fixed-width binary representation to standard output.

decrypt.py

accepts the private-key n (int) and d (int) as command-line arguments and a message to decrypt (produced by encrypt.py) from standard input, decrypts each character (represented as a fixed-width binary sequence) in the message, and writes the decrypted character to standard output.

About

RSA(Rivest-Shamir-Adleman) cryptosystem is widely used for secure communication such as credit card machines, phones, ATM machines and operating systems. It uses a random prime number and public-key to encrypt and decrypt information.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages