Crypt Files on server

Few popular encryption method

 

1. GnuPG

 

To encrypt single file, use command gpg as follows:

 

gpg -c test.txt

 

Enter password  1234

Repeat password 1234

 

This will create a test.txt.gpg file.

 

Decrypt file

gpg file.txt.gpg

 

 

2. Crypt method

 

Encrypt the original file called test2.txt

 

Type the command as follows:

 

cat test2.txt | crypt > test2.txt.cpy

 

Output:

 

Enter key:

 

This will create an encrypted form of text2.txt.cpy file

 

Decrypt the file called test2.txt

 

Type the command as follows:

 

cat test2.txt.cpy | crypt > test.decrypt.txt

 

 

3. OpenSSL method

 

Encryption:

 

openssl enc -bf -salt -in myfile.txt -out myfile.txt.enc -e –a

 

Decryption:

 

openssl enc -bf -in myfile.txt.enc -out myfile.txt.dec -d –a

Live Free Or Die!