A page sealed with age: the server that seals needs only the public key, so it can write archives it cannot read.
Pure Elixir, with no external commands or NIFs: it uses only Erlang's :crypto (X25519 recipients, HKDF-SHA256, ChaCha20-Poly1305 STREAM, and Bech32). Files sealed by Page can be opened with age -d -i key.txt, and files sealed by age -r age1... can be opened with Page.
Installation
def deps do
[
{:page, "~> 0.1"}
]
end
Usage
%{identity: identity, recipient: recipient} = Page.generate_identity()
{:ok, sealed} = Page.seal("secret", recipient)
{:ok, "secret"} = Page.open(sealed, identity)
:ok = Page.seal_file("archive.tsv", "archive.tsv.age", recipient)
:ok = Page.open_file("archive.tsv.age", "archive.tsv", identity)