Use new :crypto API
wuhkuh opened this issue ยท 6 comments
wuhkuh commented
According to the :crypto documentation block_encrypt
and block_decrypt
are old and should not be used in new applications. We should consider updating the encryption functions to the new API.
nelsonic commented
nelsonic commented
@NikitaAvvakumov kindly created the PR: #23 to update the :crypto
syntax in the README.md
we need to update it in the code
and bump the Erlang version in
.travis.yml
to 22
so that the build will actually pass:plicjo commented
Using Erlang 23+
For encryption:
{ciphertext, tag} = :crypto.crypto_one_time_aead(:aes_gcm, key, iv, to_string(plaintext), @aad, true)
For decryption:
:crypto.crypto_one_time_aead(:aes_gcm, get_key(), iv, ciphertext, @aad, tag, false)
gets the tests passing :)