Skip to content

Commit 655f410

Browse files
committed
Return encrytpion method that returns encrypted data as string
1 parent 7ecf082 commit 655f410

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Encrypt/AesEncryption/Encrypt.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ public string AesEncryptByteToHexString(byte[] data, byte[] secretKey, byte[] iv
2626

2727
return cipherText.ByteArrayToHexString();
2828
}
29+
30+
public string AesEncryptByteToBase64String(byte[] data, byte[] secretKey, byte[] iv)
31+
{
32+
var cipherText = EncryptAES(data, secretKey, iv);
33+
34+
return Convert.ToBase64String(cipherText);
35+
}
36+
2937

3038

3139
private void NullChecks(string data, string secretKey, string iv)

0 commit comments

Comments
 (0)