pamoja-audit
Tamper-evident audit logs for pamoja: signed, hash-chained entries so altering, reordering, or dropping a record is detectable.
The same capability in every language
| Language | Package | Reference |
|---|---|---|
| Rust | pamoja-audit |
reference, docs.rs, install |
| TypeScript | @pamoja/audit |
reference, install |
| Python | pamoja-audit |
reference, install |
| C# | Pamoja.Audit |
reference, install |
Tamper-evident audit logs for the pamoja SDK.
The health and cold-chain deployments this SDK targets need more than authentic readings; they need an authentic record of them. A vaccine fridge's temperature history is only useful as evidence if no one can quietly edit out an excursion, drop an inconvenient reading, or reorder the log after the fact. This crate provides that record by chaining signed entries together:
AuditLog- appends entries, each signed with aDeviceIdentityand linked by hash to the entry before it.Entry- one record: its payload, its index, the previous entry's digest, and the signature, with a byte form for durable storage.Verifierandverify_chain- replay a stored log and confirm, against the device'sPublicIdentity, that every entry is in sequence, correctly chained, and authentically signed.
Because each entry commits to the previous one with a SHA-256 hash and an ed25519
signature, altering a payload, reordering entries, inserting a forgery, or
dropping a record all break verification at the point of tampering. The crate is
no_std and synchronous, so the same log can be written on a microcontroller and
audited on a server.
Examples
use ;
use DeviceIdentity;
let device = from_seed;
let public = device.public;
// Record two readings, persisting each entry's bytes as you would to an SD card.
let mut log = new;
let mut stored: = Vecnew;
for reading in
// An auditor rebuilds the chain from storage and verifies it.
let entries: = stored
.iter
.map
.
.unwrap;
assert!;
License
MIT - part of the pamoja workspace: one memory-safe Rust core with bindings for every language.