| Crates.io | aman |
| lib.rs | aman |
| version | 0.1.1 |
| created_at | 2025-12-06 23:40:46.30362+00 |
| updated_at | 2025-12-07 00:28:08.49177+00 |
| description | The definitive, high-performance binary integrity & signing platform. Supports P-256, Ed25519, Multi-sig, and Anti-tamper. |
| homepage | |
| repository | https://github.com/theHamdiz/aman |
| max_upload_size | |
| id | 1970918 |
| size | 77,972 |
"Security" in Arabic.
The definitive, high-performance binary integrity & signing platform for Rust.
Aman is not just a library; it's a compliance backbone. It embeds cryptographic proofs directly into your executables, ensuring that what you shipped is exactly what is running.
Aman is built for distinct, high-stakes environments. Which one are you?
Problem: You distribute a CLI tool handling crypto-wallets. If a malware wraps your binary or injects code, user funds are lost. You need Runtime Self-Defense and Key Rotation capabilities without forcing users to update the binary instantly.
Solution:
use aman::shield;
fn main() {
// ๐ก๏ธ Enforces: Integrity + Anti-Debug + Expiry check
// If verification fails, the process aborts with code 0xC0DE.
shield! {
keys: [include_str!("root.pub")],
consensus: 1
}
println!("๐ธ Secure Transaction Started...");
}
Problem: You are deploying firmware to embedded devices (ARM/RISC-V). You have 64KB RAM. You need verification, but standard std libraries are too heavy.
Solution:
no_std Native: Aman's core is no_std compatible (with alloc).[dependencies]
aman = { version = "0.1.0", default-features = false, features = ["ed25519"] }
Problem: A rogue employee pushes a malicious update. You need to ensure that at least 3 senior developers have signed off on every release.
Solution:
consensus: 3 at runtime.# Developers sign independently
aman sign --binary myapp --key dev1.pem
aman sign --binary myapp --key dev2.pem
aman sign --binary myapp --key dev3.pem
Why not just use GPG or OS Code Signing?
| Feature | Aman ๐ก๏ธ | GPG / Sigstore | OS Codesign (Authenticode/Codesign) |
|---|---|---|---|
| Verification Scope | Self-Verifying (App checks itself) | External (User checks file) | External (OS checks file) |
| Runtime Enforcement | โ Yes (Panic/Exit inside app) | โ No (Can run even if check fails) | โ ๏ธ OS Dependent |
| Key Rotation | โ Root-of-Trust Chain | โ Hard to rotate keys | โ Certificate Authorities |
| Developer Experience | One Macro (shield!) |
โ Complexity Hell | โ Expensive Certs & Tooling |
| Performance | Zero-Copy / Memory Mapped | Slow (External processes) | Fast (Kernel space) |
| Cross-Platform | โ Linux, Win, Mac, Embedded | โ Linux/Mac mostly | โ OS Specific |
[dependencies]
aman = "0.1.0"
aman)Aman v0.1.0 brings a unified toolchain.
Generate Keys (Root CA):
cargo run --bin aman -- keys root
# Outputs: root.pem, root.pub
Generate Delegate Certificate (Valid 90 days):
cargo run --bin aman -- keys delegate --root-key root.pem --days 90
# Outputs: delegate.pem, delegate.cert
Sign Binary:
# Standard Signing
aman sign --binary ./target/release/myapp --key delegate.pem --cert delegate.cert
aman::shield! (Production)The nuclear option. Use this for production releases.
aman::shield! {
keys: [include_str!("root.pub")],
consensus: 1
}
aman::development! (Debug Friendly)Same as shield, but warns instead of panicking. Allows debuggers to attach.
aman::development! {
keys: [include_str!("root.pub")]
}
aman::check! (Custom Logic)Returns a Result<(), String> for custom error handling.
if let Err(e) = aman::check!(keys: [KEY]) {
log::error!("Security alert: {}", e);
// graceful shutdown
}
To solve the key rotation problem without forcing users to update their binaries, Aman separates Trust Anchors from Signing Keys.
Verification Flow:
Aman speaks universal C ABI. Verify your Rust binaries from Python, Node, or Legacy C++.
Headers are automatic.
We use cbindgen to generate a fresh aman.h every time you build. No more out-of-sync headers causing segfaults.
#include "aman.h" // Generated in your target directory
int main() {
const char* root_key = "...";
if (aman_verify_self(root_key) != 0) {
printf("Tampered binary!\n");
return 1;
}
return 0;
}
aman: The high-level library (what you are reading about).aman-core: The low-level, no_std logic engine.xaman: The hermetic build tool that orchestrates everything.MIT. Build with confidence.