Scoop API

scoop:scoop.crypto:0.1.0

encrypt

function encrypt

source · line 36
public
public fun encrypt(algorithm: AeadAlgorithm, key: SecretKey, nonce: List<Byte>, plaintext: List<Byte>, aad: List<Byte> = Array<Byte>(0L) { _ -> 0.toByte() }): AeadCiphertext

Encrypts and authenticates plaintext and associated data with AES-GCM. The caller must use a fresh nonce for each encryption under the same key. Key size and 12-byte nonce length are checked.