

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 9
click for more info
Not enough gems
Cost: 6 gems
1: Feistel Network
incomplete
2: Feistel Network
incomplete
3: Data Encryption Standard
incomplete
4: DES Review
incomplete
5: Initialization Vectors
incomplete
6: DES Feistel Network
incomplete
7: Substitution Box
incomplete
8: Substitution Box
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Many block ciphers, including DES which we'll be talking about soon, use a Feistel network (or "Feistel Cipher") as a key component of their encryption algorithms.
Feistel structures have the useful property that encryption and decryption operations are very similar and sometimes identical. Decryption only requires a reversal of the key schedule. This keeps the implementation of the algorithms simple and concise.
n = The number of ciphering roundsL0 = Left (first) half of the plaintext bytesR0 = Right (second) half of the plaintext bytesK0 - Kn = The round keys (from a key schedule)F = The round function (specific to the ciphering algorithm, like DES for example)One of the most interesting things about Feistel networks is that the round function does NOT have to be reversible.
A Feistel cipher is not a fully-fledged encryption algorithm but is rather a framework that more complete cipher implementations (like DES) utilize.
For marketing purposes, Passly has decided to create its own Feistel network. It will use the Go standard library's SHA-256 hash function as the round function.
Here's some pseudocode:
func feistel(msg []byte, roundKeys [][]byte) []byte
nextRHS = xor(lhs, hash(rhs+key))nextLHS = oldRHSThe hash() and xor() functions are provided for you.
Click to play video