@@ -27,10 +27,11 @@ public byte[] AesEncrypt(string data, string secretKey, string iv)
2727 public byte [ ] AesDecrypt ( string data , string secretKey , string iv )
2828 {
2929 NullChecks ( data , secretKey , iv ) ;
30- var convertedKeys = ConvertKeysToBytes ( secretKey , iv ) ;
30+ // var convertedKeys = ConvertKeysToBytes(secretKey, iv);
3131
32- var aesKey = convertedKeys . Item1 ;
33- var aesIv = convertedKeys . Item2 ;
32+ var ( aesKey , aesIv ) = ConvertKeysToBytesAndGetKeys ( secretKey , iv ) ;
33+ //var aesKey = convertedKeys.Item1;
34+ //var aesIv = convertedKeys.Item2;
3435
3536 var aesData = data . HexadecimalStringToByteArray ( ) ;
3637 return DecryptAES ( aesData , aesKey , aesIv ) ;
@@ -101,6 +102,13 @@ private void NullChecks(string data, string secretKey, string iv)
101102
102103 return ( secret , iv ) ;
103104 }
105+
106+ private ( byte [ ] , byte [ ] ) ConvertKeysToBytesAndGetKeys ( string secretKey , string iv )
107+ {
108+ var convertedKeys = ConvertKeysToBytes ( secretKey , iv ) ;
109+
110+ return ( convertedKeys . Item1 , convertedKeys . Item2 ) ;
111+ }
104112 private void NullChecks ( string data , string secretKey )
105113 {
106114 if ( data == null || data . Length <= 0 )
0 commit comments