@@ -22,7 +22,7 @@ public class AesEncryption : BaseAesEncryption
2222 /// <param name="secretKey">The secret key used for encryption.</param>
2323 /// <param name="iv">The initialization vector used for encryption.</param>
2424 /// <returns>The encrypted data as a byte array.</returns>
25- public EncryptionData EncryptToHexString ( EncryptionParameters param )
25+ public EncryptionData EncryptToHexString ( EncryptionParameters param , CipherMode mode = CipherMode . CBC )
2626 {
2727 var responseData = new EncryptionData ( ) ;
2828
@@ -51,7 +51,7 @@ public EncryptionData EncryptToHexString(EncryptionParameters param)
5151 Data = param . DataToEncrypt . ConvertToHexString ( ) . HexadecimalStringToByteArray ( )
5252 } ;
5353
54- var response = EncryptAES ( byteEncryptionParameters ) ;
54+ var response = EncryptAES ( byteEncryptionParameters , mode ) ;
5555
5656 return new EncryptionData
5757 {
@@ -83,7 +83,7 @@ public EncryptionData EncryptToHexString(EncryptionParameters param)
8383 /// <exception cref="FormatException">
8484 /// Thrown if the base64secretKey is not a valid Base64-encoded string.
8585 /// </exception>
86- public EncryptionData EncryptToBase64String ( string dataToBeEncrypted , string base64secretKey )
86+ public EncryptionData EncryptToBase64String ( string dataToBeEncrypted , string base64secretKey , CipherMode mode = CipherMode . CBC )
8787 {
8888 // validate is base64
8989 if ( ! Validators . IsBase64String ( base64secretKey ) )
@@ -103,7 +103,7 @@ public EncryptionData EncryptToBase64String(string dataToBeEncrypted, string bas
103103 Data = dataToBeEncrypted . ConvertToHexString ( ) . HexadecimalStringToByteArray ( )
104104 } ;
105105
106- var response = EncryptAES ( byteEncryptionParameters ) ;
106+ var response = EncryptAES ( byteEncryptionParameters , mode ) ;
107107
108108 return new EncryptionData
109109 {
0 commit comments