Wednesday, February 13, 2013

How to encrypt and decrypt any file in Solaris?

How to encrypt/decrypt any file in Solaris:
  1. Identify the file need to be encrypted
  2. Use “crypt < filename > encrypted_file_name”
    • This process will ask for a key – this will become password to open that file.
  3. Note that while encrypting the file, the original file will be deleted.
  4. Next is how to read that encrypted file:
    • Use “crypt < encrypted_file_name”
    • This process will ask for same password which was given initially while encrypting the file.
Input data file:
unixgeek(staff)@server1[66]> cat important
THis is an important file!

To encrypt:
unixgeek(staff)@server1[67]> crypt < important > out
Enter key: UNIXTEAM   Note:: “UNIXTEAM” will become password to decrypt this file.

To Decrypt:
unixgeek(staff)@server1[68]> crypt < out
Enter key: UNIXTEAM   Note:: Same password to decrypt this file as given during encrypting the file.
THis is an important file!
Enjoy!!! :)

No comments: