node-aescrypt
Version:
A node implementation of the AES Crypt <https://www.aescrypt.com/> file encryption format.
27 lines (26 loc) • 958 B
TypeScript
/// <reference types="node" />
import { Transform } from 'stream';
import { TransformCallback } from './util';
/**
* Encrypt a Buffer using the AES Crypt file format.
*
* Create a stream transformer that takes any [Readable stream](https://nodejs.org/api/stream.html)
* and passes on a Readable stream of the encrypted Buffer in the
* [AES Crypt file format](https://www.aescrypt.com/aes_file_format.html).
*/
export declare class Encrypt extends Transform {
static buffer(password: string, buffer: Buffer): Promise<Buffer>;
private password;
private cipher;
private hmac;
private contentLength;
constructor(password: string, options?: any);
_transform(chunk: Buffer, _: string, callback: TransformCallback): void;
_flush(callback: TransformCallback): void;
private _init;
private _pushFileHeader;
private _pushExtensions;
private _getCredentials;
private _pushCredentials;
private _getCipher;
}