UNPKG

@enteocode/nestjs-mfa

Version:

Implementation agnostic RFC-compliant Multi-Factor Authentication (2FA/MFA) module for NestJS with recovery code support

25 lines (24 loc) 680 B
import type { MfaModuleOptionsInterface } from './mfa.module.options.interface'; export declare class CipherService { private readonly logger; private readonly secret; constructor({ cipher }: MfaModuleOptionsInterface); /** * Encrypts the value with AES-256-GCM * * This algorithm is authenticated, used in TLS 1.3, SSH and servers for * its bandwidth (~500-800 MB/s) and protection against padding oracle * attacks * * @internal * @param buffer */ encrypt(buffer: Buffer): Buffer; /** * Decrypts the stored value * * @internal * @param buffer */ decrypt(buffer: Buffer): Buffer; }