![](/var/ezflow_site/storage/images/archive/2022/72/encrypt-and-decrypt-files-with-age-or-rage/photobypierrechatel-innocentionunsplash.png/199993-1-eng-US/PhotobyPierreChatel-InnocentionUnsplash.png_medium.png)
Encrypt and decrypt files with Age or Rage
Keep It Simple
Encrypting files ensures the IT security protection goal of confidentiality. Depending on which method you use, integrity and accountability can be ensured, as well. Asymmetric encryption is easier with Age than with GnuPG. In this article, I look at how to use Age and how you can use it in practice.
The Role of Encryption
IT security protection goals define requirements for data or the contents of files during storage or transmission. File encryption is useful and important in many enterprise scenarios. Encryption makes sense, and not just when you need to send data over insecure channels such as the Internet, but also for data that is no longer needed in everyday life or that is already backed up and no longer needs to be kept available in the clear. Cryptographic techniques can be used to store such data confidentially and verify its integrity on recovery.
Encrypted backups or routinely encrypted older files in an archive primarily provide protection against a potential attacker copying large volumes of information and subsequently publishing or selling this information to other market players. Of course, this does not protect you against ransomware infestation. Also, the assigned private key or password used for decryption should not simply be stored on the hard drive of your computer or server.
Not Always GnuPG
Many distributors use GnuPG to sign their packages and distribute the public key accordingly. Therefore, most distributions are capable of encrypting or signing files out of the box. At the command line, you can easily sign a file with a private key stored in the keychain:
gpg --detach-sign -o sig.gpg secret.txt
After doing so, the file sig.gpg
with the signature can be forwarded to the recipient. With your public key, it is easy to check whether the file has been
Buy this article as PDF
(incl. VAT)