Skip to content

Encrypt/Decrypt commands

Latest
Compare
Choose a tag to compare
@angelsolaorbaiceta angelsolaorbaiceta released this 05 Sep 16:42
· 6 commits to main since this release
2787c37

Summary

Two new commands are added:

  • encrypt
  • decrypt

These commands are used to encrypt and decrypt archive files respectively.
They only work with angel archives by checking the passed in file magic.

Encrypted archives have the "AARX" file magic.

Example

Let's say you have an archive.aarch file with two files in it:

$ aar list -f archive.aarch

Archive has the following files:
> fib.go (Offset: 45 bytes, Compressed size: 332 bytes)
> photo.jpg (Offset: 377 bytes, Compressed size: 53852 bytes)

To encrypt it:

$ aar encrypt -f archive.aarch
Password: <enter a password>
Confirm password: <enter the same password>

Archive encrypted successfully to archive.aarch.enc

This removes the archive.aarch file and creates the encrypted version in its place: archive.aarch.enc.

To decrypt it:

$ aar decrypt -f archive.aarch.enc
Password: <enter a password>
Confirm password: <enter the same password>

Archive decrypted successfully to archive.aarch

This removes the encrypted file and brings back the original archive.aarch file.