Skip to content

Commit d591168

Browse files
authored
Merge pull request #13 from selfmadecode/dev
merge Dev into master
2 parents b2d2414 + 04d7024 commit d591168

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Encrypt/AesEncryption/AesEncryption.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ public byte[] AesEncrypt(string data, string secretKey, string iv)
2424
return EncryptAES(aesData, aesKey, aesIv);
2525
}
2626

27+
public byte[] AesDecrypt(string data, string secretKey, string iv)
28+
{
29+
NullChecks(data, secretKey, iv);
30+
var convertedKeys = ConvertKeysToBytes(secretKey, iv);
31+
32+
var aesKey = convertedKeys.Item1;
33+
var aesIv = convertedKeys.Item2;
34+
35+
var aesData = data.HexadecimalStringToByteArray();
36+
return DecryptAES(aesData, aesKey, aesIv);
37+
}
38+
2739
public AesEncryptionData AesEncrypt(string data, string secretKey)
2840
{
2941
NullChecks(data, secretKey);

0 commit comments

Comments
 (0)