| File | Class and methods | What it is |
| sha1.js, sha256.js, md5.js | Sha1.digest(bytes), Sha256.digest(bytes), Md5.digest(bytes) | Hashes (FIPS 180-4, RFC 1321); each also has DIGEST_LENGTH and BLOCK_SIZE. The class itself is what Hmac, Pbkdf2 and Pkcs12Kdf take as hash. |
| hmac.js | Hmac.sign(hash, key, message) | HMAC (RFC 2104) with any of the hashes, for example Hmac.sign(Sha256, key, data). |
| pbkdf2.js | Pbkdf2.derive({ hash, password, salt, iterations, length }) | PBKDF2 (RFC 8018); password is text (UTF-8) or bytes. |
| pkcs12-kdf.js | Pkcs12Kdf.derive({ hash, password, salt, iterations, purpose, length }) | The PKCS#12 key derivation (RFC 7292, appendix B); purpose is Pkcs12Kdf.KEY, IV or MAC. |
| aes.js | new Aes(key): blockSize, encryptBlock(block), decryptBlock(block) | AES-128/192/256 (FIPS 197), 16-byte blocks. |
| des.js | new Des(key): the same methods | DES (FIPS 46-3): 8-byte key, 8-byte blocks. |
| triple-des.js | new TripleDes(key) | Encrypt-decrypt-encrypt with three DES keys (24 bytes, or 16 with K3 = K1). |
| rc2.js | new Rc2(key, effectiveBits) | RC2 (RFC 2268), 8-byte blocks; old PKCS#12 files use 40 effective bits. |
| cbc.js | Cbc.encrypt(cipher, iv, data, { padding }), Cbc.decrypt(…) | Cipher block chaining for any of the block ciphers; PKCS#7 padding unless padding: false. |
| pkcs7-padding.js | Pkcs7Padding.pad(data, blockSize), Pkcs7Padding.unpad(data, blockSize) | PKCS#7 (PKCS#5) padding; unpad throws when it is wrong. |
| pbe.js | await Pbe.decrypt(algorithmDer, encrypted, password), await Pbe.encrypt(plain, password, { iterations }), Pbe.schemeName(algorithmDer) | Password-based encryption as PKCS#8 and PKCS#12 files use it: PBES2 (PBKDF2 + AES or 3DES) and the PKCS#12 schemes (SHA-1 with 3DES or RC2). encrypt writes PBES2 with PBKDF2-HMAC-SHA256 and AES-256-CBC and returns { algorithm, encrypted }. A failed decryption's error has a reason: password-needed, wrong-password or unsupported. |