WeBeginners-Community / DocBook

Documentations of Html to every open source technologies. It's a low-code repository
30 stars 54 forks source link

RSA Algorithm #217

Closed Dharnish38 closed 1 year ago

Dharnish38 commented 1 year ago

Is your feature request related to a problem? Please describe.

@Sulagna-Dutta-Roy, I want to add the Rivest Shamir Adleman (RSA) cryptography algorithm. It s an asymmetric cryptography algorithm. Asymmetric actually means that it works on two different keys i.e. Public Key and Private key. Example: 1) A client (for example a browser) sends its public key to the server and requests some data. 2) The server encrypts the data using the client’s public key and sends the encrypted data. 3) The client receives this data and decrypts it.

Please assign me this issue. Thank you!

Describe the solution you'd like.

1) Select two large prime numbers, p and q. 2) Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption. Choose a number e less than n, such that n is relatively prime to (p - 1) x (q -1). It means that e and (p - 1) x (q - 1) have no common factor except 1. Choose "e" such that 1<e < φ (n), e is prime to φ (n), gcd (e,d(n)) =1 3) If n = p x q, then the public key is <e, n>. A plaintext message m is encrypted using a public key <e, n>. To find ciphertext from the plain text following formula is used to get ciphertext C. C = me mod n Here, m must be less than n. A larger message (>n) is treated as a concatenation of messages, each of which is encrypted separately. 4) To determine the private key, we use the following formula to calculate the d such that: de mod {(p - 1) x (q - 1)} = 1 Or de mod φ (n) = 1 5) The private key is <d, n>. A ciphertext message c is decrypted using a private key <d, n>. To calculate plain text m from the ciphertext c following formula is used to get plain text m. m = cd mod n

Describe alternatives you've considered.

-

Add any other context or screenshots about the feature request here.

The RSA Algorithm

RSA