Wednesday, June 15, 2011

Encryption of files in linux

The easiest way to encrypt a file in linux is to use some tool {openssl is very easy to use}....

1. To encrypt a file:
openssl des3 -salt -in inputfile.txt -out encryptedfile.txt

2. To decrypt the file
openssl des3 -d -salt -in encryptedfile.txt -out originalfile.txt

these action will require a password give the strength according to your needs...

OR u can use gpg as..

1. encryption
gpg -c inputfile.txt
This will generate a file inputfile.txt.gpg {this will be your encrypted file}
2. To decrypt the file
gpg -d inputfile.txt.gpg (output to stdout)
gpg -o file -d inputfile.txt.gpg (output to file)

No comments:

Post a Comment