@jscrypto/suite
v0.12.0
Published
Convenience suite registry for @jscrypto components.
Downloads
267
Readme
@jscrypto/suite
Convenience registries for official @jscrypto component packages.
The default registry uses basicPreset, the recommended starting point for
new applications. It contains:
- AES, AES-GCM AEAD, and AES-CCM AEAD
- CBC, CFB, CTR, OFB, ECB, and compatibility GCM
- Pkcs7, Pkcs5, and NoPadding
- PBKDF2 and HKDF
- OpenSSL
Salted__format support - bundled hash adapters
Use allPreset or @jscrypto/suite/all when compatibility algorithms should
also be registered:
- DES, Triple DES, RC4, RC4Drop
- SPECK
- ChaCha20, XChaCha20, ChaCha20-Poly1305, XChaCha20-Poly1305
- EvpKDF, Scrypt, and Argon2
- all padding components
import { registry } from '@jscrypto/suite';
const cipher = registry.createCipher({
cipher: 'AES',
mode: 'CBC',
padding: 'Pkcs7',
key,
});Authenticated encryption:
const aead = registry.createAead({
algorithm: 'AES-GCM',
key,
});
const sealed = aead.seal(plaintext, { nonce, aad });import { createAllRegistry } from '@jscrypto/suite/all';
const registry = createAllRegistry();suitePreset is an alias of basicPreset for compatibility with the initial
suite API.
