AES encrypt also allows word arrays (#27569)

the following code will execute fine, but typescript doesn't recognize it as valid

var input = CryptoJS.lib.WordArray.create(new Uint8Array(5));    
    var encrypted = CryptoJS.AES.encrypt(input, secretKeyString, {
      iv: CryptoJS.enc.Hex.parse('00000000000000000000000000000000'),
      mode: CryptoJS.mode.CBC,
      padding: CryptoJS.pad.Pkcs7
    });
This commit is contained in:
Scott
2018-07-25 09:07:20 -07:00
committed by Andy
parent 74bb1da61c
commit cbf3ed6074
+1 -1
View File
@@ -29,7 +29,7 @@ declare namespace CryptoJS {
interface StreamCipher extends Cipher {}
interface CipherHelper {
encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray;
encrypt(message: string | LibWordArray, secretPassphrase: string | WordArray, option?: CipherOption): WordArray;
decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage;
}
interface Encryptor {