SECRECY(1) | User's Manual | SECRECY(1) |
secrecy - libsecrecy encryption and key management tool
secrecy createKey cipher gpgid keyname
secrecy encrypt [keyhash|keyname]
secrecy decrypt
secrecy exportKey [keyhash|keyname] gpgid
secrecy importKey gpgid
secrecy listKeys
secrecy setDefaultKey keyname
The libsecrecy distribution comes with a command line tool called secrecy. This tool currently has seven subcommands: createKey, encrypt, decrypt, exportKey, importKey, listKeys and setDefaultKey.
The program secrecy accepts several subcommands. It is to be noted that, currently, secrecy has no arguments for reading and writing any file. One has to rely on the shell capabilities to read and write plain files, encrypted files, and key exports, using pipes and redirection operators. Subcommands are the following:
AES keys are stored encrypted using gpg(1) via gpgme. Each key is assigned a hash H value at creation time. H is computed as the SHA256 checksum of a randomly generated sequence. Keys are stored and searched for in the directory set in the environment variable LIBSECRECY_KEYDIR. If this variable is not set, then the subdirectory .libsecrecy inside the current users home directory, designated by the environment variable HOME, is used. Inside this directory the key for hash H is stored in the file hash/H, otherwise said: hash/3E35C013C66C66B09E3E0B923451530C62D4346D9F5165906FC94B9B4D35E28E, where the respective files are encrypted using gpgme. The secret key used for this encryption can be set at key creation time.
Create an AES256 key using your GPG ID, for instance foo@example.org, and call it mykey:
$ secrecy createKey AES256 foo@example.org mykey
3E35C013C66C66B09E3E0B923451530C62D4346D9F5165906FC94B9B4D35E28E
List available keys:
$ secrecy listKeys
mykey 3E35C013C66C66B09E3E0B923451530C62D4346D9F5165906FC94B9B4D35E28E
Set mykey as default key:
$ secrecy setDefaultKey mykey
Encrypt file into file.encrypted, using the default key:
$ secrecy encrypt < file > file.encrypted
Decrypt file.encrypted into file.decrypted, using the default key:
$ secrecy decrypt < file.encrypted > file.decrypted
Prepare an export of mykey for use by the person behind GPG ID bar@example.org, whose public key should be accessible in the user's gpg(1) keyring. The key will be exported into the file export.key:
$ secrecy exportKey mykey bar@example.org > export.key
secrecy is a program part of the libsecrecy, written by German Tischler-Höhle <germant@miltenyibiotec.de>.
The present manual page is written by Étienne Mollier <emollier@debian.org> for the Debian project.
See the GnuPG documentation relative to key management for creating and handling gpg(1) keys.
2020-11-13 | GNU |