Expand description
AES-CBC key minting (NIST SP 800-38A; PKCS#7 padding, the Web
Cryptography API’s AES-CBC): cipher.cipher-keys for the
unauthenticated mode, served for compatibility with CBC-committed
formats. Read the cipher interface’s Security notes first.
Ciphertext is the padded encryption of the plaintext: always a non-zero multiple of 16 bytes (a full padding block is added when the plaintext is already block-aligned).
Security:
- The 16-byte IV must be unpredictable to an attacker who can influence future plaintexts (CWE-329; the BEAST class), not merely unique: generate it fresh and randomly per message.
- CBC with visible decryption failures is padding-oracle-prone by
nature. The
cipherkind’s uniform-failure rule bounds what this API reveals to the verdict itself; protocols that surface the verdict per message to an active attacker remain at risk. Preferaes-gcmanywhere the format is not already fixed.
Functions§
- derive_
key - Mint a key from a parameterized derivation (the
aes-gcm.derive-keycontract, minting acipher-key). - generate_
key - Generate a fresh random key of the given AES variant. Fails with
error.unsupportedif this implementation does not serve the variant. - import_
key_ jwk - Import an RFC 7517 JSON Web Key as an AES-CBC key of the declared
variant. The key must be an
octkey whosealg, if present, names the declared variant ("A128CBC"/"A192CBC"/"A256CBC"); otherwise asaes-gcm.import-key-jwk. - import_
key_ raw - Import raw key material as the declared AES variant (see
aes-gcm.import-key-rawfor the variant-redundancy contract). - unwrap_
key_ jwk - Mint a key from unwrapped key material read as an
octJWK, subject toimport-key-jwk’s contract.inputis consumed. - unwrap_
key_ raw - Mint a key from unwrapped key material read as raw bytes, subject
to
import-key-raw’s contract.inputis consumed; seeaes-gcm.unwrap-key-rawfor the options model.