Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

vic/anproto-rs

Rust implementation of ANProto: the Authenticated and Non-networked protocol or ANother protocol.

vic/anproto-rs.json
{
"defaultBranch": "main",
"description": "Rust implementation of ANProto: the Authenticated and Non-networked protocol or ANother protocol.",
"fullName": "vic/anproto-rs",
"homepage": "https://anproto.com",
"language": "Rust",
"name": "anproto-rs",
"pushedAt": "2025-11-20T21:50:14Z",
"stargazersCount": 1,
"updatedAt": "2025-11-20T21:50:17Z",
"url": "https://github.com/vic/anproto-rs"
}

Crates.io Docs.rs License

Rust implementation of ANProto: the Authenticated and Non-networked protocol or ANother protocol.

ANProto is a protocol for authenticated, non-networked messages using ed25519 signatures, timestamps, and SHA-256 hashes, all base64-encoded.

Add to your Cargo.toml:

[dependencies]
anproto = "0.1"
use anproto::*;
let key = gen().unwrap();
let hash = hash("Hello World");
let signed = sign(&hash, &key).unwrap();
let opened = open(&signed).unwrap();
  • gen() -> Result<String, String>: Generates an ed25519 keypair, returns base64(public + secret).
  • hash(data: &str) -> String: Computes SHA-256 of data, returns base64 hash.
  • sign(hash: &str, key: &str) -> Result<String, String>: Signs (timestamp + hash) with the secret key, returns base64(public + signature + timestamp + hash).
  • open(signed_message: &str) -> Result<String, String>: Verifies the signature and returns (timestamp + hash) if valid.

Run the example:

Terminal window
cargo run --example example

This matches the output of the JavaScript implementation in ANProto/node_ex.js.

Run tests:

Terminal window
cargo test

Apache 2.0