Toucan is a simple stream cipher for educational purposes only. It is both a CLI and a library.
Grab the toucan/crypto
package using go get
go get github.com/penguingovernor/toucan/crypto
See the above godoc
badge for the API specification.
To avoid naming conflicts when using this package (which again, you really shouldn't be using this package), import the package under a different name, like so:
import toucan "github.com/penguingovernor/toucan/crypto"
Install appropriate version from the release page.
- Clone the repo
git clone https://github.com/penguingovernor/toucan.git toucan
- Run go build
cd toucan/cmd && go build -o toucan
FOR EDUCATIONAL PURPOSES ONLY.
Usage:
toucan [command] msgFile keyFile IVFile [outputFile]
Available Commands:
encrypt Encrypt files
decrypt Decrypt files
Flags:
-h, --help print this help message.
Notes:
If [outputFile is omitted] then stdout is used.
No. Toucan is for educational purposes only.
Read this Wiki page, it can explain it much better than I can!
An IV or initialization vector allows the reuse of keys. It doesn't have to be securely stored and can be sent along with the cipher text. As long as the IV isn't reused all should be dandy. For practical purpose, consider an IV as a secondary key that doesn't have to be secret and must only be used once.
Use a cryptographically secure pseudo random number generator!
Linux/MacOS:
head -c nBytes < /dev/urandom > file.IV
# You can also do this for your key!
Where I suggest nBytes be one of the following:
64 - for 512-bit security.
32 - for 256-bit security.
16 - for 128-bit security.
Windows:
Download a POSIX shell like git bash and repeat above steps.
Linux/MacOS:
echo -n "key" | toucan encrypt file /dev/stdin IV file.out
echo -n "key" | toucan decrypt file.out /dev/stdin IV file.decrypted