Crates.io | cfs_openpgp |
lib.rs | cfs_openpgp |
version | 0.1.0 |
source | src |
created_at | 2021-04-04 03:55:18.131058 |
updated_at | 2021-04-04 03:55:18.131058 |
description | cfs_openpgp generates a valid OpenPGP certificate based on the username, email, and secret you provide. Though the ASCII-armored representation of the cert will differ, the same input should. always produce the same keys. Obviously, this is highly insecure and should never be used or unicorns and kittens will cry. |
homepage | |
repository | https://github.com/moismailzai/cfs_openpgp |
max_upload_size | |
id | 378604 |
size | 47,325 |
Mostly, this crate is just an excuse to familiarize myself with Rust.
Imagine you have a secure, real-world source of entropy that you use as a root key (for instance, https://dicekeys.com/). You may reasonably wish to use the same root (combined with a salt) to generate reproducible cryptographic secret keys. This way, if your cryptographic secrets are ever compromised, you can use the secure physical key with a new salt to generate new ones. If your secrets are lost, however, you can just rebuild them using your physical key and the previous salt.
This application is a very thin wrapper around sequoia_openpgp
that takes an input passphrase and generates a valid pgp
certificate with a primary EdDSA Edwards-curve Digital Signature Algorithm key and 4 subordinate keys:
Clone the codebase locally and run like so:
cargo run -- --username "Alice" --email "alice@example.com" --key-sig-time 0 --weeks-subkeys-exp-in 52 --secret "a super-secure secret phrase that's been generated from real entropy"
This will output your ASCII-armored PGP certificate, a revocation signature, and the IDs and ASCII-armored representations of each key.
NOTE: BE SURE TO USE THE EXACT SAME VERSION OF THIS LIBRARY (AND THUS THE SAME NETTLE AND SEQUOIA-OPENPGP LIBRARIES) OR YOU MAY NOT GENERATE THE SAME KEY.
Many thanks to Neal Walfield of the sequoia_openpgp project for all the help on freenode #sequoia.