SDES Encryption Example with K1 = 00010011, K2 = 00100100, and Plaintext = 00100011
First, let's convert all the given numbers into binary:
K1 = 00010011 K2 = 00100100 Plaintext = 00100011
Now, let's apply the SDES encryption process:
-
Initial Permutation (IP) We apply the initial permutation to the plaintext: 00100011 -> 10000110
-
Round 1 We use K1 as the key for the first round. We split the output of the IP into two halves: L0 and R0, each with 4 bits. Then, we apply the following operations:
- Expansion/Permutation (EP) on R0: 01000100
- XOR with K1: 01010111
- Split into two halves: 0101 and 0111
- Apply S0 and S1 substitution boxes: S0(0101) = 0010 and S1(0111) = 1010
- Concatenate the outputs of the S-boxes: 00101010
- Apply a Permutation/Transposition (P4) to obtain the output of round 1: 10100001
- Round 2 We use K2 as the key for the second round. We split the output of round 1 into two halves: L1 and R1, each with 4 bits. Then, we apply the following operations:
- Expansion/Permutation (EP) on R1: 10001000
- XOR with K2: 10101100
- Split into two halves: 1010 and 1100
- Apply S0 and S1 substitution boxes: S0(1010) = 1001 and S1(1100) = 0000
- Concatenate the outputs of the S-boxes: 10010000
- Apply a Permutation/Transposition (P4) to obtain the final ciphertext: 00001001
- Final Permutation (IP-1) We apply the final permutation to the output of round 2: 00001001 -> 01000010
Therefore, the encrypted ciphertext is 01000010.
原文地址: https://www.cveoy.top/t/topic/naia 著作权归作者所有。请勿转载和采集!