---
# System prepended metadata

title: SSN Lab 3 - Symmetrical encryption
tags: [finished]

---

###### tags: `finished`

:::success
# SSN Lab 3 - Symmetrical encryption
:::

## Task 1 - DES

:::info
1. Next, use the DES simulator (launch .jar file). Step through the process of encrypting your name with the key 0x0101010101010101 and write the internal state of the device at the 8th round.
:::

Since the key must necessarily consist of 16 characters, the source data will be "polinafi" = 706f6c696e616669.

<center>
    
![](https://i.imgur.com/OhxTOG3.png)

Figure 1 - Round eight
</center>

:::info
2. Inspect the key schedule phase for the given key and explain how the sub keys are generated for each of the 16 steps.
3. Comment on the behavior of DES when using the given key.
:::
DES has a key schedule in which a 56-bit key is divided into two 28-bit halves. After the separation occurs, each half is processed separately. In consecutive rounds, both halves are rotated to the left by one or two bits (specified for each round), and then 48 bits of the round are selected using permutation selection 2 (PC-2) - 24 bits from the left half and 24 bits from the right. Rotations result in a different set of bits being used in each round key; each bit is used in about 14 of the 16 round keys.


<center>
    
![](https://i.imgur.com/raLSiLj.png)
![](https://i.imgur.com/URLgjYg.png)
Figure 2 - Sub kyes
</center>

During operation, the secret 56-bit key is split into 16 connections according to the DES key schedule; one connection is used in each of the sixteen DES rounds. Weak DES keys generate sixteen identical subkeys. Therefore, when we use the weak key 0x0101010101010101, we get this result.

## Task 2 - AES

:::info
4. Identify the Shannon diffusion element(s).

:::
**Confusion:** An encryption operation where the relationship between key and ciphertext is obscured. Today, a common element for achieving confusion is substitution

<center>
    
![](https://i.imgur.com/MTHgdH8.png)
Figure 3 - SubBytes operations
</center>

Here you can see a step called SubBytes. It assumes a simple substitution that converts each byte to a different value. AES defines a table of 256 values for substitution, the table itself is formed using a mathematical formula and is not arbitrary.

:::info
5. Also identify the Shannon confusion element(s).
:::

**Diffusion:** An encryption operation where the influence of one plaintext symbol is spread over many ciphertext symbols with the goal of hiding statistical properties of the plaintext. A simple diffusion element is the bit permutation.

In AES, the shift row layer is a permutation.

<center>
    
![](https://i.imgur.com/MSnpqna.png)
Figure 4 - ShiftRows operations
</center>

Each row is rotated to the right by a certain number of bytes. And ShiftRows ensures that each column after the step includes a byte from each column before the step.


## References:

1. [Steps in the AES Encryption Process](http://etutorials.org/Networking/802.11+security.+wi-fi+protected+access+and+802.11i/Appendixes/Appendix+A.+Overview+of+the+AES+Block+Cipher/Steps+in+the+AES+Encryption+Process/)