@doctormckay/steam-crypto

中文文档
1.2.0发布于 2017/01/27MIT零依赖近 30 天下载 12.7万

Node.js implementation of Valve's crypto

原始使用文档
文档目录6 节
  1. verifySignature(data, signature[, algorithm])
  2. generateSessionKey([nonce])
  3. symmetricEncrypt(input, sessionKey[, iv])
  4. symmetricEncryptWithHmacIv(input, sessionKey)
  5. symmetricDecrypt(input, sessionKey[, checkHmac])
  6. symmetricDecryptECB(input, sessionKey)

node-steam-crypto

Node.js implementation of Steam crypto. All keys, data, and signatures are passed as Buffers.

Fork of, and compatible with, steam-crypto.

verifySignature(data, signature[, algorithm])

Verifies an RSA signature using the Steam system's public key. algorithm defaults to "RSA-SHA1". Returns true if the signature is valid, or false if not.

generateSessionKey([nonce])

  • nonce - If you were prompted by Steam with a nonce, provide it here (as a Buffer)

Generates a 32 byte random blob of data and encrypts it with RSA using the Steam system's public key. Returns an object with the following properties:

  • plain - the generated session key
  • encrypted - the encrypted session key

If you provided a nonce, then encrypted is the RSA'd concatenation of the session key and the nonce (in that order).

symmetricEncrypt(input, sessionKey[, iv])

Encrypts input using sessionKey and iv (or a securely-random IV if you don't provide one) and returns the result.

symmetricEncryptWithHmacIv(input, sessionKey)

Encrypts input using sessionKey and an IV which is partially comprised of an HMAC of the input.

symmetricDecrypt(input, sessionKey[, checkHmac])

Decrypts input using sessionKey and returns the result.

If the IV in this ciphertext contains an HMAC, pass true for checkHmac and it will be validated. Otherwise, it will not be validated (default behavior).

symmetricDecryptECB(input, sessionKey)

Decrypts input using sessionKey and the AES/ECB/PKCS7 cipher without an IV and returns the result.

版本与发布记录

@doctormckay/steam-crypto 共发布 4 个版本,首次发布于 2016/04/11;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.2.0latest2017/01/279 年前
1.1.02016/05/2510 年前
1.0.02016/04/1410 年前
0.0.12016/04/1110 年前

关于 @doctormckay/steam-crypto 的常见问题

@doctormckay/steam-crypto 是什么?

Node.js implementation of Valve's crypto

如何安装 @doctormckay/steam-crypto?

在项目目录运行 npm install @doctormckay/steam-crypto,或使用 pnpm add / yarn add / bun add。

@doctormckay/steam-crypto 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/doctormckay__steam-crypto 是否存在。

@doctormckay/steam-crypto 可以商用吗?

@doctormckay/steam-crypto 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@doctormckay/steam-crypto 的下载量有多少?

根据 npm 官方下载统计,@doctormckay/steam-crypto 在 2026/10/13 – 2026/11/11 这 30 天内被下载 127,198 次,日均约 4,240 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@doctormckay/steam-crypto 还在维护吗?

最新版本 1.2.0 发布于 2017/01/27(9 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2016/04/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。