Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SRP

Hierarchy

  • SRP

Index

Properties

Methods

Properties

Static params

params: { 1024: object; 1536: object; 2048: object; 3072: object; 4096: object; 6244: object; 8192: object; hap: object } = srpParams

Type declaration

  • 1024: object
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 1536: object
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 2048: object
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 3072: object
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 4096: object
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 6244: object
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 8192: object
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • hap: object
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string

Methods

Static computeVerifier

  • computeVerifier(params: SrpParams, salt: Buffer, I: Buffer, P: Buffer): Buffer
  • The verifier is calculated as described in Section 3 of [SRP-RFC]. We give the algorithm here for convenience.

    The verifier (v) is computed based on the salt (s), user name (I), password (P), and group parameters (N, g).

        x = H(s | H(I | ":" | P))
        v = g^x % N

    Parameters

    • params: SrpParams

      Group parameters, with .N, .g, .hash

    • salt: Buffer
    • I: Buffer

      User identity

    • P: Buffer

      User password

    Returns Buffer

Static genKey

  • genKey(callback: GenKeyCallback): void
  • genKey(bytes: number, callback: GenKeyCallback): void
  • genKey(bytes?: undefined | number): Promise<Buffer>
  • Generate a random key with a length of 32 bytes

    Parameters

    Returns void

  • Generate a random key.

    Parameters

    Returns void

  • Generate a random key.

    Parameters

    • Optional bytes: undefined | number

      Length of key. Defaults to 32.

    Returns Promise<Buffer>