Data Encryption Standard Simplified-DES Details of DES DES in - - PDF document

data encryption standard
SMART_READER_LITE
LIVE PREVIEW

Data Encryption Standard Simplified-DES Details of DES DES in - - PDF document

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Data Encryption Standard Simplified-DES Details of DES DES in OpenSSL Cryptography DES in Python School of Engineering and Technology CQUniversity


slide-1
SLIDE 1

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Data Encryption Standard

Cryptography

School of Engineering and Technology CQUniversity Australia

Prepared by Steven Gordon on 19 Feb 2020, des.tex, r1788

1

slide-2
SLIDE 2

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Contents

Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

2

slide-3
SLIDE 3

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Data Encryption Standard

◮ Symmetric block cipher ◮ 56-bit key, 64-bit input block, 64-bit output block ◮ Developed in 1977 by NIST; designed by IBM (Lucifer) with input from NSA ◮ Principles used in other ciphers, e.g. 3DES, IDEA

3

slide-4
SLIDE 4

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Contents

Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

4

slide-5
SLIDE 5

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Simplified DES

◮ Input (plaintext) block: 8-bits ◮ Output (ciphertext) block: 8-bits ◮ Key: 10-bits ◮ Rounds: 2 ◮ Round keys generated using permutations and left shifts ◮ Encryption: initial permutation, round function, switch halves ◮ Decryption: Same as encryption, except round keys used in opposite order

5

slide-6
SLIDE 6

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

S-DES Algorithm

6

The figure on slide 6 shows the encryption, key generation and decryption steps of S-DES. Key generation, shown in the middle, is used to generate round keys and is the same algorithm when used for both encryption and

  • decryption. That is, the encrypter and decrypter will generate the exact

same round keys. Decryption is in fact identical to encryption, except the round keys are used in the opposite order. That is, for encryption round key K1 is used first, then round key K2. For decryption, K2 is used first and then K1. The blocks are defined in the following.

slide-7
SLIDE 7

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

S-DES Permutations (definition)

Permutations used in S-DES: P10 (permutate) Input : 1 2 3 4 5 6 7 8 9 10 Output: 3 5 2 7 4 10 1 9 8 6 P8 (select and permutate) Input : 1 2 3 4 5 6 7 8 9 10 Output: 6 3 7 4 8 5 10 9 P4 (permutate) Input : 1 2 3 4 Output: 2 4 3 1 EP (expand and permutate) Input : 1 2 3 4 Output: 4 1 2 3 2 3 4 1 IP (initial permutation) Input : 1 2 3 4 5 6 7 8 Output: 2 6 3 1 4 8 5 7

7

As an example, permutation P4 takes a 4-bit input and produces a 4-bit

  • utput. The 1st bit of the input becomes the 4th bit of the output. The

2nd bit of the input becomes the 1st bit of the output. The 3rd bit of the input becomes the 3rd bit of the output. The 4th bit of the input becomes the 1st bit on the output. The permutations are fixed. That is they are always these exact permu- tations, and known by the encrypter, decrypter and attacker.

slide-8
SLIDE 8

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Other Operations in S-DES

◮ LS-1: left shift by 1 position ◮ LS-2: left shift by 2 positions ◮ IP−1: inverse of IP, such that X = IP−1(IP(X)) ◮ SW: swap the halves ◮ fK: a round function using round key K ◮ F: internal function in each round ◮ Angled lines through arrows with a number next to them indicate the number of bits passing between the blocks

8

slide-9
SLIDE 9

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

S-DES Key Generation

9

The figure on slide 9 shows the key generation algorithm in S-DES. A 10-bit shared secret key is input to P10, of which the output is split into two 5-bit halves. A left shift is performed on each half. The two 5-bit halves are input to P8, and the output of P8 becomes round key K1. The two outputs of the previous left shifts are then shifted again by 2 positions (LS-2). The two 5-bit halves are input to P8, and the output of P8 becomes round key K2. K1 and K2 are used by the encryption and decryption algorithms.

slide-10
SLIDE 10

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

S-DES Encryption

10

The figure on slide 10 shows the encryption algorithm in detail. An initial permutation is applied on the plaintext, then split into the left and right half. The right half is input into function F. The 4 bits of the right half are expanded and permutated, and then the 8 bits are XORed with the round key. The left 4 bits are used in S-Box S0 and the right 4 bits are used in S-Box S1. Each S-Box outputs 2 bits. The resulting 4 bits are input to P4. The output of the 4 bits from P4 are XORed with the left half out of IP. The resulting 4 bits as well as the 4-bit right half from IP are input to the SWap, i.e. swapping the halves. The round is repeated, this time using K2, and finally the inverse initial permutation is applied to produce the ciphertext.

slide-11
SLIDE 11

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

S-DES S-Boxes (definition)

S-Box considered as a matrix: input used to select row/column; selected element is output 4-bit input: bit1, bit2, bit3, bit4 bit1bit4 specifies row (0, 1, 2 or 3 in decimal) bit2bit3 specifies column S0 =     01 00 11 10 11 10 01 00 00 10 01 11 11 01 11 10     S1 =     00 01 10 11 10 00 01 11 11 00 01 00 10 01 00 11    

11

slide-12
SLIDE 12

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Encrypt with S-DES (exercise)

Show that when the plaintext 01110010 is encrypted using S-DES with key 1010000010 that the ciphertext obtained is 01110111.

12

  • 1. Rearrange K using P10: 1000001100
  • 2. Left shift by 1 position both the left and right halves: 00001 11000
  • 3. Rearrange the halves with P8 to produce K1: 10100100
  • 4. Left shift by 2 positions the left and right halves: 00100 00011
  • 5. Rearrange the halves with P8 to produce K2: 01000011
slide-13
SLIDE 13

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

S-DES Summary

◮ Educational encryption algorithm ◮ S-DES expressed as functions: ciphertext = IP−1 (fK2 (SW (fK1 (IP (plaintext))))) plaintext = IP−1 (fK1 (SW (fK2 (IP (ciphertext))))) ◮ Brute force attack on S-DES is easy since only 10-bit key ◮ If know plaintext and corresponding ciphertext, can we determine key? Very hard

15

slide-14
SLIDE 14

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

S-DES Compared to Real DES

◮ S-DES vs DES ◮ Block size: 8 bits vs 64 bits ◮ Rounds: 2 vs 16 ◮ IP: 8 bits vs 64 bits ◮ F: 4 bits vs 32 bits ◮ S-Boxes: 2 vs 8 ◮ Round key: 8 bits vs 48 bits

16

The following section presents the details of DES. This is primarily for reference (or as evidence of the similarities and differences with S-DES). You are not expected to know the details of the DES operations.

slide-15
SLIDE 15

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Contents

Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

17

slide-16
SLIDE 16

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

General DES Encryption Algorithm

18

The figure on slide 18 shows the overall steps in DES encryption as well as key generation. The details of each block are shown in the following.

slide-17
SLIDE 17

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Permutation Tables for DES

19

The figure on slide 19 shows the initial permutation and it’s inverse. The table is read row-by-row. So the 58th input bit becomes the 1st output

  • bit. The 50th input bit becomes the 2nd output bit. And the 7th input

bit becomes the 64th output bit.

slide-18
SLIDE 18

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Permutation Tables for DES

20

The figure on slide 20 shows E and P which are used within a round of DES, shown in The figure on slide 21.

slide-19
SLIDE 19

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Single Round of DES Algorithm

21

The figure on slide 21 shows the details of a single round. The similarities with S-DES round (The figure on slide 10) can be seen. The internal function F operates on the right 32 bits input to the round. A 48 bit round key is used.

slide-20
SLIDE 20

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Calculation of F(R,K)

22

The figure on slide 22 shows the details of the function F from The figure

  • n slide 21. It shows that the 8 S-Boxes are used, each with 6 bits in and

4 bits out.

slide-21
SLIDE 21

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Definition of DES S-Boxes

23

The figure on slide 23 shows the first 4 S-Boxes. Each S-Box takes a 6 bit

  • input. The first and last bit are used to determine the row, and the middle 4

bits determine the column. The result is a decimal values within the range 0 to 15, which determines the 4 bit output. See the Stallings textbook

  • r https://en.wikipedia.org/wiki/DES_supplementary_material

for an example of reading the S-Boxes.

slide-22
SLIDE 22

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Definition of DES S-Boxes

24

The figure on slide 24 shows the last 4 S-Boxes.

slide-23
SLIDE 23

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

DES Key Schedule Calculation

25

The figure on slide 25 shows operations used in key generation. Permutated Choices are read the same as IP. The schedule of left shifts indicates how many bits are shifted left when a Left Shift is applied in each round.

slide-24
SLIDE 24

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Contents

Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

26

slide-25
SLIDE 25

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

27

slide-26
SLIDE 26

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

DES Key Generation (exercise)

Generate a shared secret key to be used with DES and share it with another person.

28

slide-27
SLIDE 27

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

DES Encryption (exercise)

Create a message in a plain text file and after using DES, send the ciphertext to the person you shared the key with.

29

slide-28
SLIDE 28

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

DES Decryption (exercise)

Decrypt the ciphertext you received.

30

slide-29
SLIDE 29

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

Contents

Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

31

slide-30
SLIDE 30

Cryptography Data Encryption Standard Overview of the Data Encryption Standard (DES) Simplified-DES Details of DES DES in OpenSSL DES in Python

AES in Python Cryptography Library

◮ cryptography.io/en/latest/hazmat/primitives/symmetric- encryption/

32