It is possible to encrypt and decrypt files and directories in Linux in a simple way, although there are many projects and possible ways dedicated to this. We have already talked about LUKS, eCryptFS, and a multitude of other tools on other occasions. Now we will present a simple but effective tool to encrypt content from our team called ash. In addition to describing its installation and basic operation step by step in this mini-tutorial.
Why do I need to encrypt? Well the answer is simple, For securityIn this way, an unauthorized third party could not have access to the files and directories on our computer unless they know the password or passphrase to decrypt them (or there is some kind of vulnerability such as in MD4), or rather, it access the files but the only thing you could see is the encrypted content that is totally incomprehensible to a human instead of the plain text or any content that the encrypted file had ...
With ash we can encrypt our files and directories using encryption AES-CBC-256, that is to say, a fairly secure system. Specifically, ash is a modular framework for Bash written to be simple and to be used from the CLI. For your installation:
curl https://raw.githubusercontent.com/ash-shell/ash/master/install.sh | sh ash apm:install https://github.com/ash-shell/cipher.git
Once installed, the following is get to work with him. It is as simple as typing the following in case you want to encrypt a file example.txt:
ash cipher:e ejemplo.txt
Will ask us encryption password and after that it will generate a file example.enc. That if we try to access it we will see that its content is a gibberish of nonsense alphanumeric symbols. To decrypt again, all you have to do is:
ash cipher:d ejemplo.enc
And we already have it as before ... For directories it is exactly the same, replacing example.txt or example.enc with directory_name / and directory_name.tar.gz.enc.