Public key Algorithms in Cryptography

Suthesana
3 min readJul 29, 2020

--

Public key cryptography which may be also called as asymmetric cryptography, uses public and private keys for the encryption and decryption of the data. The keys are just large numbers which are paired together though they are asymmetric means not identical. Public Key is One of the key in the pair can be shared with everybody whereas Private key is the other key in the pair that is kept secret; it is known as the private key. Any key can be used to encrypt a message then the other key which isn’t used for the encryption is used for the decryption.

How does Asymmetric Encryption work?

A public key and Private key are produced pairs randomly, using a algorithm and therefore the keys have a mathematical relationship with one another. The key must be longer in length (128 bits, 256 bits) to make it more stronger and impossible to break the key regardless of whether other paired key is known. The amount of possible keys increments relatively with the key length and hence cracking it likewise gets harder.

The data is encrypted by using any one of the keys and it is decrypted with the other.

The algorithms used in the asymmetric encryption are : RSA, ElGamal, elliptic curves, and DH

RSA

RSA algorithm is the most known asymmetric key cryptographic algorithm dependent on the mathematical fact that it’s easy to find and multiply enormous prime numbers yet hard to factor their product. It utilizes both public and private key (Keys must be huge prime numbers). Numerical researches recommend that if value off keys is 100 digit number, at that point it would take over 70 years for attackers to discover the value of keys. The real challenge in the RSA algorithm is to pick and produce the general private and public keys.

How does RSA algorithm works:

1. Select any two large prime numbers to say A and B

2. Calculate N = A * B

3. Select public key says E for encryption. Select the public key in a way such that it isn’t a factor of (A — 1) and (B — 1)

4. Choose private key says D for decryption. Select the private key in a way such that it matches the equation mentioned below

(D * E) mod (A — 1) * (B — 1) = 1

5. Calculate the cipher text from the plain text for encryption by using the below-mentioned equation

CT = PT^E mod N

6. Send cipher text to the receiver

7. Calculate the plain text from the Cipher text for decryption by using the below-mentioned equation

DH

DH is mostly utilized when the data is exchanged utilizing an IPsec VPN, data is encrypted on the Internet utilizing either SSL or TLS, or on the other hand when SSH data is exchanged.

ElGamal

ElGamal is a public key algorithm built on top of Diffie-Hellman key exchange. Like Diffie-Hellman, it contain no arrangements for authentication on its own, and is commonly joined with other mechanisms for this reason.

ElGamal was mostly utilized in PGP, GNU Privacy Guard and different systems since its main rival, RSA, was patented. RSA’s patent terminated in 2000, which permitted it to be implemented openly after that date. From that point forward, ElGamal has not been implemented as offten.

--

--

No responses yet