1751847 Members
5004 Online
108782 Solutions
New Discussion юеВ

How to encrypt a file ?

 
AA786
Frequent Advisor

How to encrypt a file ?

how to encrypt a file
i mean how to applying password?
4 REPLIES 4
Deepak Kulkarni
Regular Advisor

Re: How to encrypt a file ?

Hi,

Use gpg command for the same.

Regards
DK
Steven Schweda
Honored Contributor

Re: How to encrypt a file ?

GnuPG (gpg) is certainly one possibility.
The right answer may depend on why you want
the file encrypted, and what you intend to do
with it.
Ivan Ferreira
Honored Contributor

Re: How to encrypt a file ?

Depending of the file, if it's just a text file, you can use the :X commmand in vi.

You can also use the zip -e command:

zip -e test.zip testfile
Enter password:
Verify password:
adding: prueba (stored 0%)


I see in your profile "I have assigned points to 26 of 55 responses to my questions."

Please keep asigning points.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Rasheed Tamton
Honored Contributor

Re: How to encrypt a file ?

All the above are valid.

Also you can use the openssl one

Encrypt file.txt to file.out using 256-bit AES
$ openssl enc -aes-256-cbc -salt -in file.txt -out file.out
Type password
verfy passwd

Decrypt encrypted file file.out
$ openssl enc -d -aes-256-cbc -in file.out
Type passwd to decrypt