Mod 2
Mod 2
DES is a symmetric block cipher that uses a secret key to encrypt and decrypt data in blocks of 64
bits. Here's a simplified explanation of the steps involved in DES encryption:
1. Initial Permutation (IP): The first step involves rearranging the 64-bit data block using a fixed
substitution table. This process helps to diffuse the data and obscure its statistical properties.
2. Splitting & Feistel Network: The permuted data is then split into two 32-bit halves, Left (L) and
Right (R). These halves are processed through 16 rounds of the Feistel network.
3. Feistel Network Rounds: In each round, the right half (R) of the data is XORed with a subkey
generated from the main key. The output is then processed through an Expansion/Permutation
(EP) function, S-boxes, and a Permutation (P) function before being XORed with the left half (L) of
the data. The left and right halves swap places for the next round.
4. Final Permutation (FP): After all 16 rounds, the halves are swapped one last time, and then
combined. A final permutation (FP) is applied to the combined data to create the 64-bit ciphertext
block.
It's important to note that DES is considered insecure for modern cryptographic applications due to
its short key length (56 bits). More advanced algorithms, such as AES, are now widely used.
Initial Round: The data block (State) undergoes an AddRoundKey transformation using the first
round key.
Rounds 1 to 9 (or 10, 12 depending on key size): These rounds consist of four transformations
applied sequentially on the State:
1. SubBytes: Each byte in the State is substituted with a new byte using a predefined S-box.
2. ShiftRows: Rows in the State are shifted to the left by a specific offset.
3. MixColumns: Certain columns in the State are subjected to a matrix multiplication operation to
diffuse the data.
4. AddRoundKey: The State is XORed with the corresponding round key.
Final Round: Similar to rounds 1 to 9, the State undergoes SubBytes and ShiftRows
transformations. However, the MixColumns step is skipped, and a final AddRoundKey operation is
performed using the last round key.
The number of rounds varies depending on the key size used (128-bit, 192-bit, or 256-bit). It's
important to note that the decryption process involves the inverse operations of these steps.
To create an RSA public/private key pair, here are the basic steps:
3- Calcuate φ ( n ) = ( p – 1 )×( q – 1 ).
4- Select integer e such that gcd (φ( n ), e) = 1 and 1 < e < φ( n ). (* gcd is greater common divisor)
To encrypt a message, M, with the public key (e, n), create the ciphertext, C, using the equation:
C = Me mod n
The receiver then decrypts the ciphertext with the private key (d, n) using the equation:
M = Cd mod n