Skip to content

penguingovernor/toucan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toucan is a simple stream cipher for educational purposes only. It is both a CLI and a library.

GoDoc Go Report Card

API Installation

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"

CLI Installation

Universal

Install appropriate version from the release page.

From source

  1. Clone the repo

git clone https://github.com/penguingovernor/toucan.git toucan

  1. Run go build

cd toucan/cmd && go build -o toucan

Usage

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.

F.A.Q.

Is this secure?

No. Toucan is for educational purposes only.

How does this work?

Read this Wiki page, it can explain it much better than I can!

What's an IV?

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.

How do I come up with an IV/Key?

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.

How can I use standard input?

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