RSA algorithm is an asymmetric cryptography algorithm. Asymmetric actually means that it works on two different keys i.e. Public Key and Private Key. As the name describes that the Public Key is given to everyone and the Private key is kept private.
An example of asymmetric cryptography :
- A client (for example browser) sends its public key to the server and requests for some data.
- The server encrypts the data using the client’s public key and sends the encrypted data.
- Client receives this data and decrypts it.
Since this is asymmetric, nobody else except the browser can decrypt the data even if a third party has the public key of browser.
Digital signatures are used to verify the authenticity of the message sent electronically. A digital signature algorithm uses a public key system. The intended transmitter signs his/her message with his/her private key and the intended receiver verifies it with the transmitter’s public key. A digital signature can provide message authentication, message integrity and non-repudiation services.
RSA Key Generation:
- Choose two large prime numbers p and q
- Calculate n=p*q
- Select public key e such that it is not a factor of (p-1)*(q-1)
- Select private key d such that the following equation is true (d*e)mod(p-1)(q-1)=1 or d is inverse of E in modulo (p-1)*(q-1)
RSA Digital Signature Scheme: In RSA, d is private; e and n are public.
- Alice creates her digital signature using S=M^d mod n where M is the message
- Alice sends Message M and Signature S to Bob
- Bob computes M1=S^e mod n
- If M1=M then Bob accepts the data sent by Alice.
Below is the implementation.
decryption key is: 160009 As M = M1, Accept the message sent by Alice
- How to generate Large Prime numbers for RSA Algorithm
- Implementing Shamir's Secret Sharing Scheme in Python
- SymPy | Permutation.signature() in Python
- Python - Get Function Signature
- Schnorr Identification Scheme
- Python | Create a digital clock using Tkinter
- Create digital clock using Python-Turtle
- PyQt5 - Create a digital clock
- PyQt5 – Digital StopWatch
- Python | Create video using multiple images using OpenCV
- Python | Create a stopwatch using clock object in kivy using .kv file
- Image resizing using Seam carving using OpenCV in Python
- Python | Visualizing O(n) using Python
- Python - Read blob object in python using wand library
- Creating and updating PowerPoint Presentations in Python using python - pptx
- Circular (Oval like) button using canvas in kivy (using .kv file)
- Send mail from your Gmail account using Python
- Cartooning an Image using OpenCV - Python
- Using Iterations in Python Effectively
- Create a Website Alarm Using Python