deterministics

command module
v0.0.0-...-e00744e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2022 License: MIT Imports: 3 Imported by: 0

README

Deterministics

A tool to generate a deterministic RSA keypair from a passphrase.

Caveat: this isn't for ideal world scenarios.

Why?

Sometimes it's required to have symmetric key material on disk that is derived from user input.

In some scenarios the key is only used to encrypt, and the decryption is done elsewhere. Hence asymmetric keys make sense.

The approach

This was inspired by the response to a question by Thomas Pornin: https://crypto.stackexchange.com/a/1665/7763

Testing

$ go build
$ ./deterministics mypassphrase
KeyGen Complete.
$ go test -v ./...
=== RUN   TestRoundTripWithGeneratedKeys
    outputs_test.go:15: reading RSA key from outdir/test.priv
    outputs_test.go:22: RSA PRIVATE KEY
    outputs_test.go:48: PUBLIC KEY
--- PASS: TestRoundTripWithGeneratedKeys (0.01s)
PASS
ok      github.com/joekir/deterministics        0.017s
=== RUN   TestSameKeyGeneratedEachTime
    deterministics_test.go:18: /tmp/deterministics_tests004736468
--- PASS: TestSameKeyGeneratedEachTime (1.11s)
PASS
ok      github.com/joekir/deterministics/lib    1.115s

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL