Skip to content

Commit

Permalink
Specify key length for cipher, as needed in OTP22.
Browse files Browse the repository at this point in the history
Use aes_128_cfb128 instead of aes_cfb128
  • Loading branch information
mworrell committed Jun 17, 2021
1 parent 1f4f56d commit aafaeeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/termit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ sign(Data, Key) ->
Cipher :: binary().

encrypt(Data, Key, IV) ->
Crypt = crypto:crypto_one_time(aes_cfb128, Key, IV, Data, true),
Crypt = crypto:crypto_one_time(aes_128_cfb128, Key, IV, Data, true),
<< IV/binary, Crypt/binary>>.

-spec uncrypt(
Expand All @@ -105,7 +105,7 @@ encrypt(Data, Key, IV) ->
Uncrypted :: binary().

uncrypt(<< IV:16/binary, Data/binary >>, Key) ->
crypto:crypto_one_time(aes_cfb128, Key, IV, Data, false).
crypto:crypto_one_time(aes_128_cfb128, Key, IV, Data, false).


%%
Expand Down

0 comments on commit aafaeeb

Please sign in to comment.