Skip to content

Commit

Permalink
AES encrypt also allows word arrays (#27569)
Browse files Browse the repository at this point in the history
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
    });
  • Loading branch information
buddamus authored and Andy committed Jul 25, 2018
1 parent 74bb1da commit cbf3ed6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/crypto-js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cbf3ed6

Please sign in to comment.