iex(4)> System.otp_release()
"24"
iex(5)> clear_text = "my-clear-text"
"my-clear-text"
iex(6)> auth_data = "my-auth-data"
"my-auth-data"
iex(7)> {:ok, aes_256_key} = ExCrypto.generate_aes_key(:aes_256, :bytes)
{:ok,
<<16, 212, 156, 208, 202, 106, 240, 39, 18, 138, 213, 17, 35, 15, 50, 53, 156,
60, 141, 243, 97, 61, 145, 27, 178, 31, 106, 172, 167, 224, 213, 119>>}
iex(8)> {:ok, {ad, {init_vec, cipher_text, cipher_tag}}} = ExCrypto.encrypt(aes_256_key, auth_data, clear_text)
** (UndefinedFunctionError) function :crypto.block_encrypt/4 is undefined or private, use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto(dyn_iv)?init + crypto:crypto(dyn_iv)?_update + crypto:crypto_final instead
(crypto 5.0.2) :crypto.block_encrypt(:aes_gcm, <<16, 212, 156, 208, 202, 106, 240, 39, 18, 138, 213, 17, 35, 15, 50, 53, 156, 60, 141, 243, 97, 61, 145, 27, 178, 31, 106, 172, 167, 224, 213, 119>>, <<75, 167, 47, 63, 228, 39, 177, 233, 98, 107, 47, 119, 119, 193, 82, 54>>, {"my-auth-data", "my-clear-text"})
(ex_crypto 0.10.0) lib/ex_crypto.ex:317: ExCrypto._encrypt/4
iex(4)> System.otp_release()
"24"
iex(5)> clear_text = "my-clear-text"
"my-clear-text"
iex(6)> auth_data = "my-auth-data"
"my-auth-data"
iex(7)> {:ok, aes_256_key} = ExCrypto.generate_aes_key(:aes_256, :bytes)
{:ok,
<<16, 212, 156, 208, 202, 106, 240, 39, 18, 138, 213, 17, 35, 15, 50, 53, 156,
60, 141, 243, 97, 61, 145, 27, 178, 31, 106, 172, 167, 224, 213, 119>>}
iex(8)> {:ok, {ad, {init_vec, cipher_text, cipher_tag}}} = ExCrypto.encrypt(aes_256_key, auth_data, clear_text)
** (UndefinedFunctionError) function :crypto.block_encrypt/4 is undefined or private, use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto(dyn_iv)?init + crypto:crypto(dyn_iv)?_update + crypto:crypto_final instead
(crypto 5.0.2) :crypto.block_encrypt(:aes_gcm, <<16, 212, 156, 208, 202, 106, 240, 39, 18, 138, 213, 17, 35, 15, 50, 53, 156, 60, 141, 243, 97, 61, 145, 27, 178, 31, 106, 172, 167, 224, 213, 119>>, <<75, 167, 47, 63, 228, 39, 177, 233, 98, 107, 47, 119, 119, 193, 82, 54>>, {"my-auth-data", "my-clear-text"})
(ex_crypto 0.10.0) lib/ex_crypto.ex:317: ExCrypto._encrypt/4