You are on page 1of 5

[CS304] Introduction to Cryptography and Network Security

Course Instructor: Dr. Dibyendu Roy Winter 2023-2024


Scribed by: Siddharth Gupta (202151156) Lecture (Week # 2)

Hill Cipher

Key Generation:
• The key in the Hill cipher is a square matrix, often denoted as K.

• The size of the matrix (n × n) determines the block size for encryption.

• The key matrix should be invertible, meaning its determinant must be non-zero, and its
inverse should exist in modular arithmetic.

Matrix Representation of Plaintext:


• The plaintext is divided into blocks of size n, where n is the dimension of the key matrix.

• Each block is represented as a column vector.

Encryption:
• Each block of plaintext is multiplied by the key matrix modulo some fixed number (usually
the size of the alphabet or the size of the finite field).

• The result is a ciphertext block.

Mathematically, if P is the plaintext block vector and C is the ciphertext block vector, and K is
the key matrix, encryption is done as follows:

C =K ·P (mod 26)

Decryption:
• To decrypt, the ciphertext block is multiplied by the modular inverse of the key matrix.

• The result is the original plaintext block.

Mathematically, if P ′ is the original plaintext block vector and C ′ is the decrypted ciphertext block
vector:
P ′ = K −1 · C ′ (mod 26)
Here, K −1 is the modular inverse of the key matrix.

Symmetric Key CryptoGraphy

• Block Cipher

1
• Stream Ciper

Block Cipher

A block cipher is a symmetric key cryptographic algorithm that operates on fixed-size blocks
of data. It encrypts or decrypts the data in blocks, typically of fixed length, and uses a secret key
for the transformation. Each block is treated independently during the encryption or decryption
process.

Block Cipher Encryption and Decryption


Encryption:
• Let P be the plaintext block.

• Let K be the secret key.

• The encryption function E transforms the plaintext block using the key.

Mathematically: C = EK (P ), where C is the ciphertext block.

Decryption:
• Let C be the ciphertext block.

• Let K be the secret key.

• The decryption function D transforms the ciphertext block back to the original plaintext
block.

Mathematically: P = DK (C), where P is the plaintext block.


The actual mathematical expressions for E and D involve multiple rounds of substitution-
permutation operations, key expansion, and other cryptographic transformations. The specific
details depend on the block cipher algorithm being used, such as AES or DES (Data Encryption
Standard). These algorithms have their own unique set of mathematical operations that ensure
security and confidentiality in the encryption process.

Product Cipher
A product cipher is a type of symmetric-key cipher that combines multiple transformations
(substitution and permutation) to achieve higher security. It is constructed by applying two or
more simple ciphers in sequence or in parallel. The idea behind a product cipher is to overcome
the weaknesses of individual ciphers and provide a more robust and secure encryption scheme.

2
Figure 1: Substitution-Permutation Network (SPN)

Substitution-Permutation Network (SPN)


The Substitution-Permutation Network (SPN) is a type of product cipher that operates on binary
sequences of length n and transforms them into sequences of length m.
Feistel Network
The Feistel Network is a structure used in block ciphers. It involves splitting the input into two
halves, applying a function f to one half with a subkey, and then mixing the result with the other
half. This process is iterated.

Figure 2: Feistel Network

The function f operates on two inputs of length n and produces an output of length n.
For encryption, L1 = R0 and R1 = L0 ⊕ f (R0 , k).
For decryption, L0 = R1 and R0 = L1 ⊕ f (L1 , k).
Iterated Block Cipher
An Iterated Block Cipher repeats a round function for a specified number of rounds (r). It
involves a block size n, a key size, and the generation of subkeys.
For a 2-round iterated block cipher, the encryption involves f (k, p) ⇒ C1 ⇒ f (k2 , C1 ). The
decryption involves G(k) ⇒ k1 , k2 and C = f −1 (C, k2 ) ⇒ f −1 (C1 , k1 ).
Data Encryption Standard (DES)

3
Designed by IBM, DES uses a 64-bit secret key and operates on 64-bit plaintext blocks. The
key has parity check bits.

Figure 3: Data Encryption Standard (DES)

DES is based on the Feistel Network, is an iterated block cipher with 16 rounds, and uses key
scheduling to generate 48-bit subkeys.

4
Figure 4: DES Key Scheduling

You might also like