Public key Algorithms in Cryptography

deshanjali diyasena
3 min readJul 29, 2020

Public key algorithms are also known as asymmetric key algorithms which typically uses a key length of 512 to 4096 bits key size. This type of algorithms is comparingly slow than symmetric because these contain complex operations inside. RSA, DSS, ElGamal, elliptic and DH are the most popular asymmetric algorithms where sender and receiver do not share a secret key. Key is used to encrypt and decrypt data. These algorithms are functioning based on two different keys, those are the private key which is only known by the owner and a public key which is known by everyone. One is used to encrypt and the other one is used to decrypting, but the keys cannot be used with the algorithm to calculate and find one another. The advantage is there is no need of agreeing on or pre-sharing a common key. Asymmetric algorithms preserve confidentiality, authentication and integrity in two phases.

Cisco CCNA security — Chapter 07: Cryptographic systems

When we take a scenario where Alice wants to send data to Bob, in the first phase Alice encrypt the data using algorithm together with Bob’s public key. In phase two that encrypted text is again encrypted with the same algorithm using Alice’s private key and getting an encrypted hash as the result. After Bob got the message, first it is decrypted using Alice’s public key and lastly by Bob’s private key.

DSS (Digital Signature Standard)

Cisco CCNA security — Chapter 07: Cryptographic systems

This standard uses DSA as the algorithm and public key algorithm is based on ElGamal. Speed of this algorithm is similar to RSA but slow in the verification process. Key length is in 512 to 1024 range of bits. DS authenticate a source that certain party has signed the data and guarantee that data has not been altered. Third parties accept these digital signatures as proof so it cannot be repudiated. Mainly there are six steps to the digital signature process. Some of them are creating the hash of the document, encrypt with the private key of the signer, the signature is attached with the document, decryption procedure etc. This signature provides an assurance that data has not been modified after. DSS signature generation is faster than the signature verification.

RSA algorithm

https://images.app.goo.gl/VTct1rw72zc5KiGQ7

This algorithm is suitable for digital signing and encryption and widely used in electronic commerce protocols and secured with lengthy keys like in 512 to 2048 bits keys. In RSA signing verification is faster than the signature generation. RSA is a public algorithm which can be used by anyone. RSA is much slower than DES in both hardware and software. RSA preserves confidentiality, authentication and non-repudiation.

Diffie-Hellman (DH)

Key lengths (bits) — 512, 1024, 2048 where DH is for the modern and most common way of key exchange algorithm used in networks. Not used for encrypting a bulk of data because it is extremely slow just used for key exchange. It is an asymmetric algorithm founded in 1976 and also assumed that it is very safe because the time to crack this algorithm is unknown. In addition, resource consumption of DH algorithm is at a medium level.

https://images.app.goo.gl/QGHGDb6iZ3feDVQP8

--

--