How-to-encrypt-file-with-passphrase
How to encrypt file with passphrase.
DESCRIPTION
Mcrypt is a simple crypting program, a replacement for the old unix crypt(1). When encrypting or ecrypting 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. If no files are specified, the standard input is encrypted to the standard output.
Mcrypt uses all the symmetric algorithms included in libmcrypt.
Use the command mcrypt
shibu@shibu-laptop:~/Desktop$ mcrypt -uz ubuntuforenterprise
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase:
Enter passphrase:
File ubuntuforenterprise was encrypted.
shibu@shibu-laptop:~/Desktop$ ls
ubuntuforenterprise.gz.nc
shibu@shibu-laptop:~/Desktop$ file ubuntuforenterprise.gz.nc
ubuntuforenterprise.gz.nc: mcrypt 2.5 encrypted data,
algorithm: rijndael-128, keysize: 32 bytes, mode: cbc,
$ mcrypt --help
Mcrypt encrypts and decrypts files with symmetric encryption algorithms.
Usage: mcrypt [-dFusgbhLvrzp] [-f keyfile] [-k key1 key2 ...] [-m mode] [-o keymode] [-s keysize]
[-a algorithm] [-c config_file] [file ...]
-g, --openpgp Use the OpenPGP (RFC2440) file format.
--openpgp-z INTEGER Sets the compression level for openpgp
packets (0 disables).
-d, --decrypt decrypts.
-s, --keysize INTEGER Set the algorithm's key size (in
bytes).
-o, --keymode KEYMODE Specify the keyword mode. Use the
--list-keymodes parameter to view all
modes.
-f, --keyfile FILE Specify the file to read the keyword
from.
-c, --config FILE Use configuration file FILE.
-z, --gzip Use gzip to compress files before
encryption.
-p, --bzip2 Use bzip2 to compress files before
encryption.
--flush Immediately flush the output
-l, --doublecheck Double check passwords.
-u, --unlink Unlink the input file after encryption
or decryption.
--nodelete Do not delete the output file if
decryption failed.
-t, --time Prints timing information.
-F, --force Forces output to stdout.
--echo Echo asterisks when entering the
password.
-r, --random Use real random data (if your system
supports it).
--list Prints a list of the supported
algorithms and modes.
--list-keymodes Prints a list of the supported key
modes.
--list-hash Prints a list of the supported hash
algorithms.
-V, --verbose More information is displayed.
-q, --quiet Suppress some non critical warnings.
--help Prints this help
-v, --version Prints the version number
-L, --license Displays license information.







