This package implements the Feistel cipher in go.
It contains the pure Feistel Encrypt/Decrypt functions as well as
ECB and CBC implementations.
package main
import (
"log"
"github.com/Eun/go-feistel"
)
func main() {
rounds := 2
keys := []uint32{0xDEADBEEF, 0xFEEDFACE}
secretText, err := feistel.ECB.Encrypt([]byte("Hello World"), rounds, keys)
if err != nil {
log.Fatal(err)
}
plainText, err := feistel.ECB.Decrypt(secretText, rounds, keys)
if err != nil {
log.Fatal(err)
}
log.Println(string(plainText))
}