- The RSA algorithm (Rivest-Shamir-Adleman) is the basis of a cryptosystem -- a suite of cryptographic algorithms that are used for specific security services or purposes -- which enables public key encryption and is widely used to secure sensitive data, particularly when it is being sent over an insecure network such as the internet.
- How does the RSA algorithm work?
- Alice generates her RSA keys by selecting two primes: p=11 and q=13. The modulus is n=p*q=143. The totient is n Ο(n)=(pβ1)x(qβ1)=120. She chooses 7 for her RSA public key e and calculates her RSA private key using the Extended Euclidean algorithm, which gives her 103
- Bob wants to send Alice an encrypted message, M, so he obtains her RSA public key (n, e) which, in this example, is (143, 7). His plaintext message is just the number 9 and is encrypted into ciphertext, C, as follows
- M^e mod n = 9^7mod 143 = 48 = C
- When Alice receives Bob's message, she decrypts it by using her RSA private key (d, n) as follows:
- C^d mod n = 48^103 mod 143 = 9 = M
- Requirements
- Built using Python
- Navigate to the src directory
cd src
-
To start chatting
- Run the
server.py
file - Run the
client.py
file
- Run the
-
Run the
attack.py
file to get how size of input affect Time of encryption and decryption -
Run the
speed_encryption_decryption.py
file to get how size of input affect Time of encryption and decryption
Eslam Ashraf |
Note: This software is licensed under MIT License, See License for more information Β©EslamAsHhraf.