node-aescrypt
Version:
A node implementation of the AES Crypt <https://www.aescrypt.com/> file encryption format.
31 lines (30 loc) • 1.11 kB
TypeScript
/// <reference types="node" />
import { Transform } from 'stream';
import { TransformCallback } from './util';
/**
* Decrypt a Buffer that is in the AES Crypt file format.
*
* Create a stream transformer that takes [Readable stream](https://nodejs.org/api/stream.html)
* that is encrypted in the
* [AES Crypt file format](https://www.aescrypt.com/aes_file_format.html) and
* decrypts it passing it on as a Readable stream.
*/
export declare class Decrypt extends Transform {
static get MODE_FILE_HEADER(): number;
static get MODE_EXTESIONS(): number;
static get MODE_CREDENTIALS(): number;
static get MODE_DECRYPT(): number;
static buffer(password: string, buffer: Buffer): Promise<Buffer>;
private password;
private decipher;
private hmac;
private mode;
private buffer;
constructor(password: string, options?: any);
_transform(chunk: Buffer, _: string, callback: TransformCallback): void;
_flush(callback: TransformCallback): void;
private _modeFileHeader;
private _modeExtensions;
private _modeCredentials;
private _getDecipher;
}