Joaquin Peralta

My Personal weblog.

Protect your files with openssl

Protect your files :

A very secure form of protect your files is with openssl, but if you lost the password, maybe you lose all your data.
First Step :

Install openssl, if you are a Debian user, only type (as root) : apt-get install openssl;
note : SSL=Secure Sockets Layer

So, if you have installed openssl, i recomend that you use a script for encrypt or decrypt a file, and put this scripts in your favorite or personal scripts.
Encrypt Script

filename : crypt

content :

#/usr/bin/sh
#Version-0.1
openssl enc -aes-256-cbc -salt -in $1 -out $1.enc

use : Encrypting a File, use the command -> 'crypt filename.txt' After put the password (don't lose). The output file is a new file named : "filename.txt.enc" this is the file encrypted, now you can delete or move the old file "filename.txt" So, the new file "filename.txt.enc" is your new file encrypted. For decrypt File, see the next section.
Decrypt Script

filename : decrypt

content :

#/usr/bin/sh
#Version-0.1
openssl enc -d -aes-256-cbc -in $1

use : Decrypting a File, use the command -> 'decrypt filename.txt.enc' After validate your password, so the standard output is the original file. If you prefeer you can use the command 'decrypt filename.txt.enc > filename.txt', and redirect inmediatly the output to the original file.
Some Considerations

At the moment the script are work very good, with any type of file, text and binary, so if you have aproblem send me an e-mail (see this in my personal web page) the 'aes-256-cbc' flag correspond to the type of encryptation, if you are a paranoid people i recommend another encryptation method, but with this you are ok. ;)

This is all

JP

June 25, 2006 - Posted by jperalta | GNU/Linux | | 2 Comments

2 Comments »

  1. [...] Afther of put the password (don’t lose this), copy in a pendrive or another storage system this file. For more detail view the other post referent to ensure yours files. [...]

    Pingback by Joaquin Peralta » Blog Archive » Rescue your keys (privates/public others), for a reinstall of GNU/Linux. | August 12, 2006 | Reply

  2. Wonderful and informative web site.I used information from that site its great.-pharma

    Comment by http://hometown.aol.com/xyi111 | December 8, 2006 | Reply


Leave a comment