Added io.Reader/Writers to satisfy io.Copy() interface

Added cmd/main for CLI usage

Signed-off-by: Russ Magee <rmagee@gmail.com>
This commit is contained in:
Russ Magee 2020-02-06 18:52:52 -08:00
parent ce6570ddcc
commit 41d01db0ab
2 changed files with 55 additions and 4 deletions

33
cmd/main.go Normal file
View file

@ -0,0 +1,33 @@
// WANDERER - a crypto doodle that appears to give adequate
// protection to data in a stream cipher context (?)
//
// Properties visualized using https://github.com/circulosmeos/circle
//
// test command-line 'main' program
package main
// TODOs:
// -use a crypto rand (eg mtwist64) instead of go pkg rand?
// -define s-box rotation/shuffle schema
// -devise p-box schema
// ...
import (
"flag"
"io"
"os"
"blitter.com/go/cryptmt"
)
var (
k string
)
func main() {
flag.StringVar(&k, "k", "WARNING_DEFAULT_KEY", "Key (NOTE insecure specified on command line)")
flag.Parse()
c := cryptmt.New(os.Stdin, os.Stdout, []byte(k))
_, _ = io.Copy(c, c)
}