UNPKG

@swan-io/srp

Version:

A modern SRP implementation for Node.js (v15+) and web browsers

11 lines (10 loc) 777 B
import { Ephemeral, HashAlgorithm, PrimeGroup, Session } from "./types"; export declare const createSRPClient: (hashAlgorithm: HashAlgorithm, primeGroup: PrimeGroup) => { generateSalt: () => string; derivePrivateKey: (salt: string, username: string, password: string) => Promise<string>; deriveSafePrivateKey: (salt: string, password: string, iterations?: number) => Promise<string>; deriveVerifier: (privateKey: string) => string; generateEphemeral: () => Ephemeral; deriveSession: (clientSecretEphemeral: string, serverPublicEphemeral: string, salt: string, username: string, privateKey: string) => Promise<Session>; verifySession: (clientPublicEphemeral: string, clientSession: Session, serverSessionProof: string) => Promise<void>; };