Cryptographic tools and hashes
Encryption techniques are used mainly to protect data from unauthorized access. There are many algorithms available and we have discussed the most commonly used ones. There are a few tools available in a Linux environment for performing encryption and decryption. Sometimes we use encryption algorithm hashes for verifying data integrity. This section will introduce a few commonly used cryptographic tools and a general set of algorithms that these tools can handle.
How to do it...
Let us see how to use tools such as crypt
, gpg
, base64
, md5sum
, sha1sum
, and openssl
:
The
crypt
command is a simple and relatively insecure cryptographic utility that takes a file fromstdin
and a passphrase as input and output encrypted data intostdout
(and, hence, we use redirection for the input and output files):$ crypt <input_file >output_file Enter passphrase:
It will interactively ask for a passphrase. We can also provide a passphrase through command-line arguments:
$ crypt...