Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node compatibility: "Uncaught Error: Not implemented: crypto.Cipheriv" #17848

Closed
matt1 opened this issue Jan 15, 2023 · 3 comments · Fixed by #18091 or #18412
Closed

Node compatibility: "Uncaught Error: Not implemented: crypto.Cipheriv" #17848

matt1 opened this issue Jan 15, 2023 · 3 comments · Fixed by #18091 or #18412
Labels
bug Something isn't working correctly node compat

Comments

@matt1
Copy link

matt1 commented Jan 15, 2023

Describe the bug

Trying to use https://github.com/codetheweb/tuyapi

Attempting to connect to a device using protocol v3.3 triggers this stack-trace

at notImplemented (https://deno.land/std@0.170.0/node/_utils.ts:23:9)
at new Cipheriv (https://deno.land/std@0.170.0/node/internal/crypto/cipher.ts:140:5)
at Object.createCipheriv (https://deno.land/std@0.170.0/node/crypto.ts:187:10)
at F._encryptPre34 (https://esm.sh/v102/tuyapi@7.5.1/deno/tuyapi.js:2:1741)
at F.encrypt (https://esm.sh/v102/tuyapi@7.5.1/deno/tuyapi.js:2:1699)
at C._encodePre34 (https://esm.sh/v102/tuyapi@7.5.1/deno/tuyapi.js:2:8787)
at C.encode (https://esm.sh/v102/tuyapi@7.5.1/deno/tuyapi.js:2:8678)
at v.get (https://esm.sh/v102/tuyapi@7.5.1/deno/tuyapi.js:2:11788)
at v._finishConnect (https://esm.sh/v102/tuyapi@7.5.1/deno/tuyapi.js:2:14825)
at Socket.<anonymous> (https://esm.sh/v102/tuyapi@7.5.1/deno/tuyapi.js:2:16523)

Steps to Reproduce

Bit awkward as you need a v3.3 physical "smart" device (e.g. a smart lightbulb). This is reliably triggered using the "basic usage" example in https://github.com/codetheweb/tuyapi

Expected behavior

crypto.Cipheriv implemented

Environment

$ deno --version
deno 1.29.3 (release, aarch64-unknown-linux-gnu)
v8 10.9.194.5
typescript 4.9.4

@matt1 matt1 added bug Something isn't working correctly needs triage labels Jan 15, 2023
@kt3k kt3k removed the needs triage label Jan 17, 2023
@kt3k kt3k mentioned this issue Feb 21, 2023
14 tasks
@kt3k kt3k transferred this issue from denoland/std Feb 21, 2023
@JAForbes
Copy link

JAForbes commented Mar 7, 2023

If it helps I hit the same issue with cryptr, easy repro:

import Cryptr from "https://esm.sh/cryptr@6.2.0";

const cryptr = new Cryptr('secret')
cryptr.encrypt('test') // Uncaught Error: Not implemented: crypto.Cipheriv

@bartlomieju
Copy link
Member

This is being worked on in #18091

@kt3k kt3k reopened this Mar 14, 2023
@kt3k
Copy link
Member

kt3k commented Mar 14, 2023

Reopened this issue as tuyapi module uses 'aes-128-ecb' algorithm, which is not yet supported by #18091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
4 participants