07.07.2023 Views

Implementing-cryptography-using-python

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

166 Chapter 5 ■ Stream Ciphers and Block Ciphers

plaintext

L 0 R 0

F k1

F k2

F k3

F k4

R 4 L 4

ciphertext

Figure 5.15: Feistel Network encryption

ciphertext

R 4 L 4

F k4

F k3

F k2

F k1

L 0 R 0

plaintext

Figure 5.16: Feistel Network decryption

To build the encryption scheme, write a function that consumes a length 64

string and a salt that now acts like a key. Have your scheme do four rounds of

a Feistel network and return a hex string of the 512-bit output. For now, you can

use 5,000 iterations per super-hash.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!