Digital security 02 of many: Symmetric-key algorithm

This series “Digital security” is from my notes prepared for certifications.

The cipher key is used to encrypt and also decrypt a message. Anyone who needs to decrypt the message, needs the key.

An algorithm is the logic/process of applying the key over plaintext to encrypt it. The cipher text can be de-ciphered/decrypted using the same algorithm and cipher-key(just called key).

When a shared key is required at both ends of a secure channel for encrypt and decrypt operations, the algorithm requiring using such shared key is a Symmetric-key algorithm. The same key is required for encrypting and decrypting.

Consider the binary XOR operation.

If A and B are two binary inputs, the XOR output is A’B + AB’.

ABA’B’A’BAB’A’B + AB’
0011000
0110101
1001011
1100000

Plaintext(Name) = 01001110  01100001  01101101  01100101

Cipher key = 0x22 = 00100010

Encrypt by performing Plaintext XOR key

Ciphertext = 01101100 01000011 01001111 01000111 = mCOG

Decrypt by performing Ciphertext XOR key

Decrypt result = 01001110 01100001 01101101 01100101 = Name

Basic XOR operation can be considered a symmetric key algorithm.

Block ciphers work on large blocks of data and generate the output at one shot.

Stream ciphers work on smaller chunks of a larger block and generate the output as the stream arrives.

Stream ciphers are useful for audio/video/conferencing which will benefit from data transfer in smaller chunks.

Stream ciphers are useful when transferring files or smaller data. With the advent of faster hard drives and faster networks, block ciphers have displaced stream ciphers in modern cryptography.

AES (Advanced Encryption Standard) is the most common block cipher. Block sizes are shown along with AES for clarity:

AES128, 192, 256, etc. Larger block sizes are more secure.

Leave a comment