Skip to content

Eun/go-feistel

Repository files navigation

go-feistel Travis Codecov GoDoc go-report

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))
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages