invisal / god_crypto

Pure Javascript/Typescript Crypto Implementation for Deno. AES, RSA, HMAC, and TOTP
MIT License
93 stars 16 forks source link

TypeError: crypto.subtle.importKey is not a function #36

Closed hiral-kotadiya closed 3 years ago

hiral-kotadiya commented 3 years ago

After updating, Deno v1.11.0 I am getting typeError in encryption.

const aes = new AES(this.key, { mode: "cbc", iv: this.salt }); // This works proper const cipher = await aes.encrypt(str); // Error genrates from here.

Error is: TypeError: crypto.subtle.importKey is not a function at WebCryptoAES.loadKey (https://deno.land/x/god_crypto@v1.4.9/src/aes/aes_wc.ts:24:39) at WebCryptoAES.encrypt (https://deno.land/x/god_crypto@v1.4.9/src/aes/aes_wc.ts:37:28) at AES.encrypt (https://deno.land/x/god_crypto@v1.4.9/src/aes/mod.ts:40:43)

hiral-kotadiya commented 3 years ago

Thank You. The issue is resolved.