You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when running a script that uses the createDecipheriv function with AES-256-GCM in both Node.js and Deno. The script works as expected in Node.js but throws an error in Deno due to Deno being stricter re IV length.
str
iv length: 32, value: k5oP3kb8tTbZaL3PxbFWN8ToOb8vfv2b1EuPz1LbmYU=
this is a secret
Deno output:
deno run --import-map=import_map.json --unstable-node-globals src/reduced.ts
str
iv length: 32, value: k5oP3kb8tTbZaL3PxbFWN8ToOb8vfv2b1EuPz1LbmYU=
error: Uncaught (in promise) TypeError: IV length must be 12 bytes
at new Decipheriv (ext:deno_node/internal/crypto/cipher.ts:150:21)
at createDecipheriv (node:crypto:32:10)
at file:///Users/taras/Documents/sops-age/src/reduced.ts:29:20
Expected Behavior:
The script should run without errors in both Node.js and Deno, producing the same output.
The text was updated successfully, but these errors were encountered:
I am trying to use deno to decrypt a sops file in humphd/sops-age#4
I encountered an issue when running a script that uses the
createDecipheriv
function with AES-256-GCM in both Node.js and Deno. The script works as expected in Node.js but throws an error in Deno due to Deno being stricter re IV length.I got into this problem because go is also ok with non-standard IV lengths and https://github.com/getsops/sops uses them: https://github.com/getsops/sops/blob/73fadcf6b49006b0b77ba811f05eae8d740ed511/aes/cipher.go#L92C2-L92C75
Steps to Reproduce:
Use the following TypeScript code:
Use the following
import_map.json
:Run the script in Node.js and Deno:
Node.js output:
Deno output:
Expected Behavior:
The script should run without errors in both Node.js and Deno, producing the same output.
The text was updated successfully, but these errors were encountered: