JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q40097F
  • License MIT

Steam client connection encryption/decryption protocol.

Package Exports

  • @fcastrocs/steam-client-crypto
  • @fcastrocs/steam-client-crypto/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@fcastrocs/steam-client-crypto) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

steam-client-crypto

steam-web is a Node.js module that implements the Steam client connection encryption/decryption protocol.

Installation

npm i @fcastrocs/steam-client-crypto

Usage

import SteamCrypto from "@fcastrocs/steam-client-crypto";

const hashedStr = SteamCrypto.sha1Hash("plaintext");
...

Methods

  • All methods are static.
  /**
   * Generate a 32-byte symmetric sessionkey and encrypt it with Steam's public "System" key.
   * @param nonce - obtained in channelEncryptResponse when encrypting connection to Steam
   */
  static genSessionKey(nonce: Buffer): SessionKey;
  /**
   * Encrypt data to be sent to Steam
   */
  static encrypt(data: Buffer, key: SessionKey["plain"]): Buffer;
  /**
   * Decrypt data received from Steam
   */
  static decrypt(data: Buffer, key: SessionKey["plain"]): Buffer;
  /**
   * Hash a string or buffer with sha1
   * @returns hashed hex string
   */
  static sha1Hash(input: Buffer | string): string;

  static crc32Unsigned(str: string): number;