bsrp
Version:
Secure Remote Password Protocol (SRP-6a) Implementation
19 lines (18 loc) • 819 B
TypeScript
import { BigInteger } from "jsbn";
import * as utils from "./utils";
import * as constants from "./constants";
declare const toBigInteger: (input: utils.Input) => BigInteger;
export { constants };
export { toBigInteger };
export { utils };
export interface APair {
ephemeralA: BigInteger;
publicA: BigInteger;
}
export declare const generateAPair: () => APair;
export interface ProcessedChallenge {
message: BigInteger;
sessionKey: BigInteger;
}
export declare const processChallenge: (identity: string, password: string, salt: BigInteger, ephemeralA: BigInteger, publicA: BigInteger, publicB: BigInteger) => Promise<null | ProcessedChallenge>;
export declare const verifySession: (publicA: BigInteger, message: BigInteger, sessionKey: BigInteger, serverHAMK: BigInteger) => Promise<BigInteger | null>;