nix, shell, perl, php, mysql and mac os x tips and tricks

Sunday, May 29, 2005

Using crypt to encrypt/decrypt files

A file can be encrypted in the shell mode using crypt, or in the edit mode using the -x or X option. When you are ready to decrypt the file, you can use the crypt command in the shell mode. The following is the command format to encrypt a file:
crypt < oldfile > newfile
The system prompts you for a password.



Before removing the unencrypted oldfile, make sure the encrypted newfile can be decrypted using the appropriate password.



To decrypt a file, redirect the encrypted file to a new file you can read. The command to decrypt a file is as follows:
crypt < encrypted_file > new_filename 

No comments:

Post a Comment