Encrypt plaintext using the current key, returning the ciphertext and the key version used.
The key ring (current key is used).
The data to encrypt.
Ciphertext (base64) and version identifier.
Base64-encoded ciphertext (nonce || ciphertext || tag).
Key version used for encryption.
const { ciphertext, version } = encryptWithVersion(ring, "secret"); Copy
const { ciphertext, version } = encryptWithVersion(ring, "secret");
Encrypt plaintext using the current key, returning the ciphertext and the key version used.