Strict Standards: Declaration of RSS::DoAction() should be compatible with CMSModule::DoAction($name, $id, $params, $returnid = '') in /home/xandaorg/public_html/modules/RSS/RSS.module.php on line 114

Strict Standards: Non-static method PageInfoOperations::LoadPageInfoByContentAlias() should not be called statically in /home/xandaorg/public_html/index.php on line 154

Warning: Cannot modify header information - headers already sent by (output started at /home/xandaorg/public_html/modules/RSS/RSS.module.php:114) in /home/xandaorg/public_html/index.php on line 299
Xanda - /dev/project - Linux or UNIX password protect files

mcrypt command

Mcrypt is a simple crypting program, a replacement for the old unix crypt. When encrypting or decrypting a file, a new file is created with the extension .nc and mode 0600. The new file keeps the modification date of the original. The original file may be deleted by specifying the -u parameter.


Encrypt data.txt file:

$ mcrypt data.txt


Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase:
Enter passphrase:

A new file is created with the extension .nc i.e.

$ ls data.txt.n
$ cat

Decrypt the file:

$ mcrypt -d


Enter passphrase:
File was decrypted.

Verify that file was decrypted:

$ ls data.tx
$ cat data.txt

For mcrypt to be compatible with the Solaris des, the following parameters are needed:

$ mcrypt  -a des --keymode pkdes --bare -noiv  data.txt

Delete the input file if the whole process of encryption/decryption succeeds (pass -u option):

$ mcrypt -u data.txt


$ mcrypt -u -d

openssl command

OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and related cryptography standards required by them. You can use the openssl program which is a command line tool for using the various cryptography functions of OpenSSL’s crypto library from the shell. It can be used for encrypt and decrypt files with a password:


Encrypt file.txt to file.out using 256-bit AES in CBC mode

$ openssl enc -aes-256-cbc -salt -in file.txt -out file.out

Decrypt encrypted file file.out

$ openssl enc -d -aes-256-cbc -in file.out



  • enc : Encoding with Ciphers.