AesGcmCipher

AesGcmCipher

Performs AES GCM encryption and decryption with a given key.

Constructor

new AesGcmCipher(aesKey)

Description:
  • Creates a cipher around an aes shared key.

Source:
Parameters:
Name Type Description
aesKey SharedKey256

AES shared key.

Classes

AesGcmCipher

Members

TAG_SIZE :number

Description:
  • Byte size of GCM tag.

Source:

Byte size of GCM tag.

Type:
  • number

Methods

decrypt(cipherText, iv) → {Uint8Array}

Description:
  • Decrypts cipher text with appended tag.

Source:
Parameters:
Name Type Description
cipherText Uint8Array

Cipher text with appended tag to decrypt.

iv Uint8Array

IV bytes.

Returns:

Clear text.

Type
Uint8Array

encrypt(clearText, iv) → {Uint8Array}

Description:
  • Encrypts clear text and appends tag to encrypted payload.

Source:
Parameters:
Name Type Description
clearText Uint8Array

Clear text to encrypt.

iv Uint8Array

IV bytes.

Returns:

Cipher text with appended tag.

Type
Uint8Array