KhoaNguyen55/zage
A zig implementation of age encryption
refs
The format specification is at age-encryption.org/v1. age was designed by @Benjojo and @FiloSottile.
Download executable from here.
Clone the repo: git clone https://github.com/KhoaNguyen55/zage.git
Use zig build system: zig build -Dbuild-cli --release=fast
There is 3 command: keygen
, encrypt
, and decrypt
For complete usage run zage <command> --help
zage keygen
zage keygen my_key
zage keygen > my_key
With passphrase: zage encrypt -p -o <output_file> <input_file>
With recipient: zage -r <public_key> -o <output_file> <input_file>
zage encrypt -r age1fmm3lmxh7rtzf7g6829tlr6a9mljq9xt4hd3yw7ffx9vgaywfeaqhg7dd3 text.txt
zage encrypt -i my_key -o msg.age text.txt
echo 'hello world!' | zage encrypt -i my_key -o msg.age --stdin
With passphrase: zage decrypt <input_file>
With recipient: zage decrypt -i <private_key_file> <input_file>
zage decrypt -i my_key msg.age
cat msg.age | zage decrypt -i my_key --stdin
The library is for zig v0.14.1
for now.
To install as a zig library you can run the zig fetch
command:
zig fetch --save https://github.com/KhoaNguyen55/zage/archive/refs/tags/<tag>.tar.gz
Then add the following to build.zig
:
const age = b.dependency("age", .{
.target = target,
.optimize = optimize,
});
exe_mod.addImport("age", age.module("age"));
// exe_mod.addImport("age_plugin", age.module("age_plugin")); // uncomment if you're developing a plugin
Report bugs at https://github.com/KhoaNguyen55/zage/issues
Contributing: TODO