Closed intentionally-left-nil closed 5 years ago
For example, if you provide a different Auth data for decryption:
iex> clear_text = "my-clear-text" iex> auth_data = "my-auth-data" iex> bad_auth_data = "bad-auth-data" iex> {:ok, aes_256_key} = ExCrypto.generate_aes_key(:aes_256, :bytes) iex> {:ok, {_ad, payload}} = ExCrypto.encrypt(aes_256_key, auth_data, clear_text) iex> {init_vec, cipher_text, cipher_tag} = payload iex> {:ok, :error} = ExCrypto.decrypt(aes_256_key, bad_auth_data, init_vec, cipher_text, cipher_tag)
I see what you mean, thanks for submitting the PR to fix it!
For example, if you provide a different Auth data for decryption: