Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SRP

Hierarchy

  • SRP

Index

Constructors

Properties

Methods

Constructors

constructor

  • new SRP(): SRP

Properties

Readonly Static params

params: { 1024: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 1536: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 2048: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 3072: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 4096: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 6244: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 8192: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; hap: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string } } = ...

Type declaration

  • 1024: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 1536: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 2048: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 3072: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 4096: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 6244: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • 8192: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }
    • N: BigInteger
    • N_length_bits: number
    • g: BigInteger
    • hash: string
  • hap: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }
    • 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

  • 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: number

      Length of key. Defaults to 32.

    Returns Promise<Buffer>