I am trying to do encrypt/decrypt using this https://github.com/luke-park/SecureCompatibleEncryptionExamples but the Cipher definition doesn't have getAuthTag.
is there a @types should I install?
EDIT
Just saw node/index.d.ts the getAuthTag and setAAD is is commented. I don't think it is right to remove the comment.
The reason for the issue you're having is because you're defining the algorithm as a string and it should be Cipher.CipherGCMTypes.
When you define the variable you declare the type. As Matt said, you have to pass it in as that type.
private ALGORITHM:crypto.CipherGCMTypes = 'aes-256-gcm';
let cipher:crypto.Cipher = crypto.createCipheriv(this.ALGORITHM, Buffer.from(this.encryptionKeyMessage, 'base64'), iv)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With