Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piotrpsz/blowfish
Go implementation of Blowfish
https://github.com/piotrpsz/blowfish
Last synced: about 2 months ago
JSON representation
Go implementation of Blowfish
- Host: GitHub
- URL: https://github.com/piotrpsz/blowfish
- Owner: piotrpsz
- Created: 2018-03-21T17:14:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-21T17:41:25.000Z (almost 7 years ago)
- Last Synced: 2023-07-12T08:46:20.641Z (over 1 year ago)
- Language: Go
- Size: 10.7 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blowfish
Implementation of the Blowfish encryption algorithm (the creator of the algorithm is Bruce Schneier).
It must be clear that the code is not tuned for speed - main goal is explanation how works the algorithm.To test the correctness of the operation, run the following program:
# Example: How to test```Go
func main () {
fmt.Println ()L: = uint32 (1)
R: = uint32 (2)
bf: = blowfish.New([]byte("TESTKEY"))bf.Encrypt (&L, &R)
fmt.Printf ("%08x, %08x\n", L, R)if (L == 0xdf333fd2 && R == 0x30a71bb4) {
fmt.Println ("Test encryption OK.")
} else {
fmt.Println ("Test encryption failed.")
}bf.Decrypt (&L, &R)
if (L == 1 && R == 2) {
fmt.Println ("Test decryption OK.")
} else {
fmt.Println ("Test decryption failed.");
}
}
```