Create 65 random encryption keys and encrypt those keys using gpg. Reading from /dev/random may take indefinitely long if kernel's random entropy pool is empty. If that happens, do some other work on some other console (use keyboard, mouse and disks). Use of gpg-encrypted key file depends on encrypted swap.
- head -c 3705 /dev/random | uuencode -m - | head -n 66 | tail -n 65 | gpg --symmetric -a >mykey1.gpg
Write files to bzip2 compressed, encrypted tar archive. aespipe asks for passphrase to decrypt the key file.
- tar cvf - files... | bzip2 | aespipe -w 10 -K ~/Documents/mykey1.gpg >archive.aes
Restore files from bzip2 compressed, encrypted tar archive. aespipe asks for passphrase to decrypt the key file.
- aespipe -d -K ~/Documents/mykey1.gpg <archive.aes | bzip2 -d -q | tar xvpf -