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

执行自动签到时出错 RangeError: Invalid key length #47

Closed
junpaku opened this issue Apr 20, 2022 · 4 comments
Closed

执行自动签到时出错 RangeError: Invalid key length #47

junpaku opened this issue Apr 20, 2022 · 4 comments

Comments

@junpaku
Copy link

junpaku commented Apr 20, 2022

Node.js版本:16.14.2,Windows Server 2019 Dataserver,初次导入配置文件
执行自动签到时出现如下错误

RangeError: Invalid key length
    at Cipheriv.createCipherBase (node:internal/crypto/cipher:116:19)
    at Cipheriv.createCipherWithIV (node:internal/crypto/cipher:135:3)
    at new Cipheriv (node:internal/crypto/cipher:243:3)
    at Object.createCipheriv (node:crypto:138:10)
    at AES.encrypt (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/cea/node_modules/@ceajs/core/lib/src/utils/encrypt.js:13:31)
    at login (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/cea/node_modules/@ceajs/core/lib/src/crawler/login.js:73:47)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async loginAndStoreCookie (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/cea/node_modules/@ceajs/core/lib/src/index.js:22:20)
    at async handleLogin (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/cea/node_modules/@ceajs/core/lib/src/index.js:41:17)
    at async file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/cea/node_modules/@ceajs/core/lib/src/index.js:14:13 {
  code: 'ERR_CRYPTO_INVALID_KEYLEN'
}

腾讯云函数在导入执行时也出现类似的错误(Node版本12.16)

@junpaku junpaku changed the title 执行自动签到时出错 执行自动签到时出错 RangeError: Invalid key length Apr 20, 2022
@beetcb
Copy link
Contributor

beetcb commented Apr 20, 2022

看起来是登录时的学校适配问题,没有获取到正确的 pwdSalt,导致加密不了密码
请试试 #20 的方法 @junpaku

@beetcb
Copy link
Contributor

beetcb commented Apr 21, 2022

报错信息这边其实可以优化的,所以我 Reopen 一下

@beetcb beetcb reopened this Apr 21, 2022
@beetcb
Copy link
Contributor

beetcb commented Apr 21, 2022

!TODO: 对 saltKey 长度做精确判断,再抛出合理的错误提示

@beetcb
Copy link
Contributor

beetcb commented Apr 23, 2022

#50 (comment) #48

@beetcb beetcb closed this as completed Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants