wasm-crypto-box 🛡️
Browser-safe WASM wrapper around ed25519 for use in web apps and extensions.
Features
- ed25519 keypair generation (uses browser RNG via
getrandom) - Message signing and verification
- WASM-friendly types (Uint8Array for keys and signatures)
Quickstart (Web)
- Build with
wasm-pack:
- In your web app (after bundling the
pkgoutput):
import init from './pkg/wasm_crypto_box.js';
await ;
const = ; // Uint8Array fields
const msg = .;
const sig = ;
const ok = ;
console.log;
Security Notes
- Keep secret keys confidential — do not send or expose them to untrusted contexts.
- This crate does not implement an authenticated key store; integrate with WebCrypto or extension secure storage for production.
Development
- Run
cargo check/cargo test(native tests) - Use
wasm-pack build --target webto generatepkg/for browser usage
Publishing to crates.io
Before publishing, update Cargo.toml with your repository and homepage fields (if needed) and set an appropriate authors field.
Validate packaging locally:
When ready, publish:
You can automate publishing on GitHub by setting a CARGO_REGISTRY_TOKEN secret and using the included .github/workflows/publish.yml which triggers on v* tags.
License
MIT