Cryptography is technique used to securely transmit data from source to remote destination. The basic purpose of cryptography in modern day digital world is, security, privacy, authenticity and integrity.
A cryptographic algorithm is mathematical formula used to covert plain data into cipher-data and vice versa or in other words encryption and decryption.
Cryptography is crucial technique used in network security in general information security in particular. Cryptography can be divided into following categories each on which consist of various algorithms.
Symmetric Key cryptography or Secret Key Cryptography
Symmetric Key Cryptography consist of one key and algorithm, that used to encrypt, and decrypt data uses same secret key. The secret key is securely distributed between communicating parties prior to communication, and then at time of communication sender can encrypt data using mutually agreed algorithm and receiver can decrypt data upon reception.
The key in this approach kept security but encryption algorithm remains public. There is wide variety of symmetric algorithms available and used in market today, these include but not limited to DES, Double-DES, Triple-DES, AES, MARS, IDEA and Serpent etc.
Data Encryption Standards (DES) is one of the first algorithms in this category of cryptography, introduced in 1970’ and its encryption was cracked later in 1990’ which lead to enhanced version like Double-DES and Triple-DES.
As the name suggests Double-DES encrypts the data with two times and Triple-DES three times to enhance security. Encrypting more than one time seems to be great idea to enhance security but it makes algorithm slow that’s why these algorithms were not widely adopted as compared to AES.
Advance Encryption Standards (AES) was developed in 2001, it has complex mathematical framework to encrypt data, and its 256-bit key makes a lot harder to crack the encrypted data. It was widely adopted due to its increased security and performance.
The list of these algorithms goes on and on, but the idea remains the same these algorithms are based on symmetric key cryptography, use same key for encryption and decryption, each new algorithm is advanced version based on weaknesses found in older algorithms.
Asymmetric Key cryptography or Public Key Cryptography
Asymmetric Key Cryptography on the other hand uses pair of key known as public and private keys. These two keys are different but mathematically related. Public key is used for encryption of data between communicating parties while private key is only used for decryption of data encrypted with public key. There are many algorithms used in this method of cryptography.
Diff-Hellman algorithm was the pine years of Asymmetric Cryptography, developed by Whitfield Diffie and Martin Hellman. This algorithm requires same secure delivery of private key between communicating parties. There were some vulnerabilities found in this algorithm and its not being widely used. Rivet-Shammir-Adleman (RSA) is most widely used public key algorithm in modern day digital world.
RSA depends on factorization of prime numbers, it used multiplication of two prime numbers which is almost impossible to crack in current day computer hardware in acceptable amount of time. RSA is relatively slow due to its encryption of symmetric key which interns encrypt and decrypt communication data. Most of SSL/TLS certificates in websites uses RSA.
ECC (Elliptic-Curve Cryptography) alternative to RSA and its asymmetric key algorithm which operates more or less in the same way as RSA, except it offers smaller key size which reduces the runtime complexity of algorithm which makes it more efficient as compared to RSA.
Hashing is technique in cryptography to generate fingerprint or hash code for given input. Its one-way process of encrypting called hash. Once hash is generated it can’t be used to recover the original text.
It’s also called digest, and typically used to generate finger prints for file for example, publicly available liberates or installer files; when you execute or install file on a computer the operating system can verify hash to determine its integrity.
There are quite a few hashing algorithms which includes MD (message digest) it generates 128-bit hash value for given input, MD2, MD4 and MD5 are different variations of this algorithm.
Another most popular algorithm is Security Hash Algorithm (SHA) this algorithm also has many variations mostly on hash size, SHA-256 and SHA512 are most commonly used.