Shell scripting is a very powerful tool to automate certain tasks. One of them might be storing files in cloud storage. Data encryption in such a situation might be a very good idea. Let’s see how to easily integrate file encryption into your bash scripts.

A piece of theory

TL;DR We will use a RSA key-pair to encrypt randomly generated, AES256 encryption keys for each file we protect. We will put the encrypted keys alongside the encrypted data. On the decryption side, the private RSA key will be needed (ideally stored in the vault).

#cloud-storage #cloud #bash #backup

Encrypt Your Backups Before Pushing to Cloud (in #!/bin/bash)
1.30 GEEK