UNPKG

@keyper/specs

Version:

keyper specifications

45 lines (44 loc) 1.02 kB
/// <reference types="node" /> interface V3Params { kdf: string; cipher: string; salt: string | Buffer; iv: string | Buffer; uuid: string | Buffer; dklen: number; c: number; n: number; r: number; p: number; } interface ScryptKDFParamsOut { dklen: number; n: number; p: number; r: number; salt: string; } interface PBKDFParamsOut { c: number; dklen: number; prf: string; salt: string; } declare type KDFParamsOut = ScryptKDFParamsOut | PBKDFParamsOut; interface V3Keystore { crypto: { cipher: string; cipherparams: { iv: string; }; ciphertext: string; kdf: string; kdfparams: KDFParamsOut; mac: string; }; id: string; version: number; } export declare function encrypt(privKey: Buffer, password: string, opts?: Partial<V3Params>): V3Keystore; export declare function decrypt(input: string | V3Keystore, password: string, nonStrict?: boolean): string; export {};