@ende/crypto/crypto
ende add jsr:@ende/cryptoVersion 2026.10.15 on JSR.
Extensions to the Web Crypto API supporting additional encryption APIs, but also delegating to the built-in APIs when possible.
Provides additional digest algorithms that are not part of the WebCrypto
standard as well as a subtle.digest and subtle.digestSync methods.
The KeyStack export implements the KeyRing interface
for managing rotatable keys for signing data to prevent tampering, like with
HTTP cookies.
Supported algorithms
Here is a list of supported algorithms. If the algorithm name in WebCrypto and Wasm/Rust is the same, this library prefers to use the implementation provided by WebCrypto.
Length-adjustable algorithms support the
DigestAlgorithmObject.length option.
WebCrypto:
SHA-384SHA-256(length-extendable)SHA-512(length-extendable)
Wasm/Rust:
BLAKE2BBLAKE2B-128BLAKE2B-160BLAKE2B-224BLAKE2B-256BLAKE2B-384BLAKE2SBLAKE3(length-adjustable)KECCAK-224KECCAK-256KECCAK-384KECCAK-512SHA-384SHA3-224SHA3-256SHA3-384SHA3-512SHAKE128(length-adjustable)SHAKE256(length-adjustable)TIGERRIPEMD-160(length-extendable)SHA-224(length-extendable)SHA-256(length-extendable)SHA-512(length-extendable)MD4(length-extendable and collidable)MD5(length-extendable and collidable)SHA-1(length-extendable and collidable)FNV32(non-cryptographic)FNV32A(non-cryptographic)FNV64(non-cryptographic)FNV64A(non-cryptographic)
Exports
crypto— A wrapper for WebCrypto which adds support for additional non-standard algorithms, but delegates to the runtime WebCrypto implementation whenever possible.DIGEST_ALGORITHM_NAMES— All cryptographic hash/digest algorithms supported by std/crypto.DigestAlgorithm— Extended digest algorithms accepted by stdCrypto.subtle.digest.DigestAlgorithmName— An algorithm name supported by std/crypto.DigestAlgorithmObject— Extended digest algorithm objects.StdCrypto— Extensions to the Web Crypto interface.StdSubtleCrypto— Extensions to the web standard `SubtleCrypto` interface.