Introduction ¶
Age – a new utility, written in Go, that supposedly performs excellent asymmetric encryption and more. Indeed, it looks simple and somewhat reminds me of Wireguard (utility wg). It encrypts the input stream to the output stream. Simple and understandable. Among its distinguishing features is the ability to encrypt for a group of recipients, so each can decrypt. Today’s task was to create backups btrfs disk partitions with home photos/video somewhere in the cloud, e.g., Backblaze, to save money. This is just not good enough (no trust in clouds). Data needs to be encrypted.
A 300 GiB partition and loading it in one piece, then storing it as a whole is very uninteresting. Split will help divide the file into chunks.
Generating Key ¶
It’s claimed that you can use a simple SSH public key instead of Age keys. Let’s try both ways.
|
|
We get such keys.
|
|
Encryption ¶
For simplicity, let’s generate 10 MiB of random data and immediately compare the hash sums.
|
|
Now we can encrypt. Using both archiving and splitting.
|
|
We get 10 files from chunk-00 to chunk-10.
Decryption ¶
Decrypting using SSH key.
|
|
Decrypting using Age key.
|
|
Verification ¶
Checking the hash sums.
|
|
It works. As always, later we’ll find vulnerabilities, but you can use it.