- Types of Encryption methods-
- GPG
- Ccrypt
- Bcrypt
- 7-zip
- Get all the require packages before you encrypt.
$ sudo apt-get install gnupg bcrypt ccrypt p7zip-full
- GPG
- To encrypt a single file
$gpg -c filename
To encrypt data_info.txt file
$gpg -c data_info.txt //file will get saved as data_info.txt.gpg
sample output
Enter passphrase: <your password>
Repeat passphrase: <your password>
//-c - Encrypt with symmetric cipher using a passphrase .
The default is CAST5.
The default is CAST5.
- To decrypt file using gpg command-
$gpg data_info.txt.gpg
sample output:
gpg data_info.txt.gpg
gpg:CAST5 encrypt data
Enter passphrase: <your password>
- To see list of the algorithms available-
$gpg --version
To use a different algorithm add for example: -crypto-algo
$gpg -c -crypto-algo=3DES data_info.txt
- Decrypt file and write output to file document.txt u can use-
$gpg data_info.txt.gpg -o docement.txt
2. Bcrypt
- To encrypt with bcrypt use-
$bcrypt data_info.txt //file will b saved as data_info.txt.bfe
- To decrypt the file use-
$ bcrypt data_info.txt.bfe
3. Ccrypt
- ccrypt command can be used in following ways:
- by using ccrypt directly with either the -e (to encrypt) or -d (to decrypt) options
- by using ccencrypt
- To encrypt a file-
$ ccencrypt data_info.txt //original file is replaced by data_info.txt.cpt
- To decrypt a file-
$ ccdecrypt data_info.txt.cpt
4. 7-Zip
- The 7-zip compression tool also incorporates AES encryption. To create an encrypted archive use the "-p" parameter with 7z command
enter password, then the
file will be compressed
and encrypted.
Tags:
decrypt file in linux
decrypt password in linux
encrypt file in linux
encrypt password in linux
linux
linux command