Encrypt a file using gpg

To encrypt a file using gpg command, run gpg -o myfile.tar.gpg –symmetric myfile.tar Now it will ask for a password. Once you enter password 2 times, file will be encrypted. Decrypt To decrypt a file, run gpg myfile.tar.gpg It will ask for the password, once you enter password, get file decrypted. Example This encryption process … Read more

Encrypting a file using OpenSSL

To encrypt a file, run openssl enc -aes-256-cbc -in FILE -out FILE.enc To decrypt, use openssl enc -d -aes-256-cbc -in FILE.enc -out FILE You can use -k option to provide password in commend line itself so it won’t prompt for password. Here is a script i use to take backup boby@hon-pc-01:~$ cat ~/bin/backup-my-files #!/bin/bash cd … Read more