VertexCacheSdk.Comm.GcmCryptoHelper (vertexcache_sdk v1.0.0)

View Source

AES-GCM helper module for VertexCache SDK (Elixir).

Uses AES-256-GCM with a 12-byte IV and 16-byte authentication tag. Encrypted payload is: IV || ciphertext || tag

Summary

Functions

Decodes a base64-encoded key.

Decrypts an AES-256-GCM encrypted binary of the format IV || ciphertext || tag.

Encodes a raw binary key as base64.

Encrypts the given plaintext using AES-256-GCM.

Generates a 256-bit AES key encoded in base64.

Functions

decode_base64_key(encoded)

Decodes a base64-encoded key.

decrypt(encrypted, key)

Decrypts an AES-256-GCM encrypted binary of the format IV || ciphertext || tag.

encode_base64_key(key)

Encodes a raw binary key as base64.

encrypt(plaintext, key)

Encrypts the given plaintext using AES-256-GCM.

Returns a binary of IV || ciphertext || tag.

generate_base64_key()

Generates a 256-bit AES key encoded in base64.