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 half of plaintextR0 = Right half of plaintextK0 - 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:
nextRHS = xor(lhs, hash(rhs+key))nextLHS = oldRHSThe hash() and xor() functions are provided for you.
Click to play video