command-line encryption methods

backup-local | backup | backup-rsync | backup-upload | encryption

symmetric encryption

    key=SYMMETRIC-KEY-HERE

gnupg v1

    which gpg || ln -s gpg1 /usr/bin/gpg
    ls -lF /usr/bin/gpg

version 1 is fine and check for available ciphers for symmetric encryption

    gpg --version

now here’s how to encrypt

    echo lala | gpg --no-use-agent --symmetric --cipher-algo TWOFISH \
            --passphrase "$key" --output lala.gpg
    file lala.gpg

and how to decrypt

    gpg --no-use-agent --decrypt --cipher-algo TWOFISH \
            --passphrase "$key" < lala.gpg

openssl

    openssl version
    openssl enc -ciphers

now here’s how to encrypt

    echo lala | openssl enc -camellia-256-ctr -e -k "$key" -pbkdf2 -out lala.camellia
    file lala.camellia
    cat lala.camellia

and how to decrypt

    openssl enc -camellia-256-ctr -d -k "$key" -pbkdf2 < lala.camellia

resources

other means of backup with encryption

security/netpgp https://netpgp.com/ https://man.netbsd.org/netpgp.1 https://en.wikipedia.org/wiki/Netpgp

caesar, rot13 – decrypt caesar ciphers https://man.netbsd.org/caesar.6 https://man.netbsd.org/rot13.6

gnupg

Encrypting and decrypting documents https://www.gnupg.org/gph/en/manual/x110.html

Symmetric Key Encryption with GnuPG http://www.savvyadmin.com/symmetric-key-encryption-with-gnupg/

GPG Encryption Guide - Part 4 (Symmetric Encryption) https://www.tutonics.com/2012/11/gpg-encryption-guide-part-4-symmetric.html

Home directory backup - The quick ‘n’ dirty guide https://www.dedoimedo.com/computers/linux-home-dir-backup-tar-gpg-guide.html

duplicity https://www.digitalocean.com/community/tutorials/how-to-use-duplicity-with-gpg-to-securely-automate-backups-on-ubuntu

Thread: gpg: gpg-agent is not available in this session https://ubuntuforums.org/showthread.php?t=1420156

gpg encrypt file without keyboard interaction [closed] https://stackoverflow.com/questions/9460140/gpg-encrypt-file-without-keyboard-interaction

How can I automate gpg decryption which uses a passphrase while keeping it secret? https://unix.stackexchange.com/questions/400772/how-can-i-automate-gpg-decryption-which-uses-a-passphrase-while-keeping-it-secre

Encrypt tar.gz file on create https://askubuntu.com/questions/95920/encrypt-tar-gz-file-on-create

openssl

openssl-enc, enc - symmetric cipher routines https://man.netbsd.org/openssl_enc.1

How to password protect gzip files on the command line? https://superuser.com/questions/162624/how-to-password-protect-gzip-files-on-the-command-line

How to Encrypt and Decrypt Files and Directories Using Tar and OpenSSL https://www.tecmint.com/encrypt-decrypt-files-tar-openssl-linux/

How should I change encryption according to *** WARNING : deprecated key derivation used https://askubuntu.com/questions/1093591/how-should-i-change-encryption-according-to-warning-deprecated-key-derivat

How to use OpenSSL to encrypt/decrypt files? https://stackoverflow.com/questions/16056135/how-to-use-openssl-to-encrypt-decrypt-files


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun