Skip to content

Commit

Permalink
Add CovertKeys method
Browse files Browse the repository at this point in the history
  • Loading branch information
selfmadecode committed Apr 15, 2023
1 parent 469aaaf commit bfd88a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Encrypt/AesEncryption/AesEncryption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ private void NullChecks(string data, string secretKey, string iv)
throw new ArgumentNullException(nameof(iv));
}

private (byte[], byte[]) ConvertKeysToBytes(string secretKey, string ivKey)
{
var secret = Encoding.UTF8.GetBytes(secretKey);
var iv = Encoding.UTF8.GetBytes(ivKey);

return (secret, iv);
}
private void NullChecks(string data, string secretKey)
{
if (data == null || data.Length <= 0)
Expand Down

0 comments on commit bfd88a1

Please sign in to comment.