## Types Of Cryptographic Algorithms

Cryptographic algorithms can be classified in a number of ways, including the number of keys used for encryption and decryption, as well as being defined by their application and use.

### Secret Key Cryptography (SKC)

SKC, also known as symmetric encryption, uses a single key (or set of rules) for both encryption and decryption. The sender uses the key to encrypt the plaintext (ordinary readable text) before being encrypted and sends the ciphertext (encrypted text) to the receiver. The receiver uses the same key (or rules) to decrypt the message and recover the plaintext. Since a single key is used for both functions,

In SKC the key must be known to both the sender and the receiver and itâ€™s keeping this secret that is the biggest issue with this form of cryptography. SKC schemes are either stream ciphers that operate on a single bit (computer word) at a time and through a feedback mechanism constantly changes the key or block ciphers. This means that in a stream cipher plaintext will encrypt to different ciphertext whereas the plaintext block will always encrypt to the same ciphertext when using the same key in a block cipher.

Self-synchronising stream ciphers calculate each bit in the keystream as a function of the previous n-bits. Block ciphers can operate in several modes. The four most common are Electronic Codebook (ECB) where a plaintext block is encrypted with a secret key to form a ciphertext block. In Cipher Block Chaining (CBC) two identical blocks of plaintext will each have unique ciphertext. In Cipher Feedback (CFB) data is encrypted in units smaller than the block size and the recipient receives on the decrypted text and the rest is discarded. Output Feedback (OFB) mode ensures the same plaintext block generates a different ciphertext block by using an independent internal feedback mechanism.

### Public Key Cryptography (PKC)

This two-key cryptosystem, also called asymmetric cryptography, uses one key for encryption and another for decryption, allowing secure communication without having to share a secret key.

PKC depends on one-way functions, but uses two mathematically related keys, though knowledge of one key (to encrypt) does not allow someone to easily determine the other key (to decrypt the ciphertext). This can be multiplication versus factorisation, for example 9 x16 = 144 and in reverse find the two integers multiplied to get 144 or in another example, exponentiation versus logarithms, for example 3 to the power of 6 = 729 and in reverse the two numbers used (x and y) so that logx 729 = y.

### Hash Functions

Uses a mathematical transformation to irreversibly "encrypt" information.

Cryptographic hash functions, also known as message digest functions, do not necessarily use keys, but take input data (often an entire message), and output a short, fixed length hash, and do so as a one-way function.

Message authentication codes are like cryptographic hash functions, except that a secret key is used to authenticate the hash value on receipt. These block an attack against plain hash functions.