Aes192Cipher
AES-192 cipher in Counter (CTR) mode, using HKDF-SHA3-256 to derive the key from a shared secret. See: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf (Section 6.5) for details on CTR mode.
Constructors
Constructor
new Aes192Cipher(
sharedSecret
):Aes192Cipher
Constructs an AES-192 cipher instance using a shared secret. The key is derived using HKDF-SHA3-256.
Parameters
Parameter | Type | Description |
---|---|---|
sharedSecret | Uint8Array | The shared secret to derive the AES key from. |
Returns
Aes192Cipher
Properties
Property | Type |
---|---|
key | Uint8Array |
Methods
decrypt()
decrypt(
ciphertext
,nonce
):Uint8Array
Decrypts the ciphertext array in Counter (CTR) mode.
Parameters
Parameter | Type | Description |
---|---|---|
ciphertext | Uint8Array | The data to decrypt. |
nonce | Uint8Array | An 8-byte nonce for CTR mode. |
Returns
The decrypted plaintext as a Uint8Array.
Throws
Error if the nonce is not 8 bytes long.
encrypt()
encrypt(
plaintext
,nonce
):Uint8Array
Encrypts the plaintext array in Counter (CTR) mode.
Parameters
Parameter | Type | Description |
---|---|---|
plaintext | Uint8Array | The data to encrypt. |
nonce | Uint8Array | An 8-byte nonce for CTR mode. |
Returns
The encrypted ciphertext as a Uint8Array.
Throws
Error if the nonce is not 8 bytes long.