| Crates.io | ash-core |
| lib.rs | ash-core |
| version | 2.3.3 |
| created_at | 2026-01-03 01:43:23.37654+00 |
| updated_at | 2026-01-25 20:30:56.731249+00 |
| description | ASH (Application Security Hash) - RFC 8785 compliant request integrity verification with server-signed seals, anti-replay protection, and zero client secrets |
| homepage | |
| repository | https://github.com/3maem/ash |
| max_upload_size | |
| id | 2019450 |
| size | 116,990 |
Developed by 3maem Co. | شركة عمائم
ASH (Application Security Hash) Core - Request integrity and anti-replay protection library for Rust.
cargo add ash-core
use ash_core::{canonicalize_json, build_proof, verify_proof, AshMode, VerifyInput};
// Canonicalize a JSON payload
let canonical = canonicalize_json(r#"{"z":1,"a":2}"#).unwrap();
assert_eq!(canonical, r#"{"a":2,"z":1}"#);
// Build a proof
let proof = build_proof(
AshMode::Balanced,
"POST /api/update",
"context-id-123",
None,
&canonical,
).unwrap();
// Verify a proof
let expected = proof.clone();
let input = VerifyInput::new(&expected, &proof);
assert!(verify_proof(&input));
canonicalize_json(input: &str) - Canonicalize JSON to deterministic formcanonicalize_urlencoded(input: &str) - Canonicalize URL-encoded form databuild_proof(mode, binding, context_id, nonce, payload) - Generate cryptographic proofverify_proof(input: &VerifyInput) - Verify proof matches expected valuenormalize_binding(method, path) - Normalize HTTP method and pathtiming_safe_equal(a, b) - Constant-time byte comparisonAshMode - Security mode: Minimal, Balanced, StrictAshError - Error type with code and messageBuildProofInput - Structured input for proof buildingVerifyInput - Input for proof verificationASH verifies what is being submitted, not who is submitting it. It should be used alongside authentication systems (JWT, OAuth, etc.).
ASH Source-Available License (ASAL-1.0)
See LICENSE for full terms.
© 3maem Co. | شركة عمائم