node-ciphers
Version:
Lightweight AES and DES encryption library for Node.js, featuring flexible encoding, multiple cipher modes, and TypeScript support.
28 lines (27 loc) • 1.52 kB
TypeScript
import { HasAuthTagAesCipherEncodingOptions } from "../types/aes.js";
import { Result } from "../types/index.js";
import { BaseAesCipher } from "./_internals/base/index.js";
import { BinaryLike } from "node:crypto";
import { TransformOptions } from "node:stream";
//#region src/aes/gcm.d.ts
declare class Gcm extends BaseAesCipher<HasAuthTagAesCipherEncodingOptions> {
#private;
constructor(key: BinaryLike, encodingOptions?: HasAuthTagAesCipherEncodingOptions, ivLength?: number);
decrypt(encryptedData: BinaryLike, iv: BinaryLike, authTag: BinaryLike, authTagLength?: number, encodingOptions?: HasAuthTagAesCipherEncodingOptions.Decrypt, decipherOptions?: TransformOptions): Result<string>;
decryptToJson<T = any>(encryptedData: BinaryLike, iv: BinaryLike, authTag: BinaryLike, authTagLength?: number, encodingOptions?: HasAuthTagAesCipherEncodingOptions.Decrypt, decipherOptions?: TransformOptions): Result<T>;
encrypt(data: BinaryLike, authTagLength?: number, ivLength?: number, encodingOptions?: HasAuthTagAesCipherEncodingOptions.Encrypt, cipherOptions?: TransformOptions): Result<{
authTag: string;
authTagLength?: number;
data: string;
iv: string;
}>;
encryptJson(data: any, authTagLength?: number, ivLength?: number, encodingOptions?: HasAuthTagAesCipherEncodingOptions.Encrypt, cipherOptions?: TransformOptions): Result<{
authTag: string;
authTagLength?: number;
data: string;
iv: string;
}>;
}
//#endregion
export { Gcm };
//# sourceMappingURL=gcm.d.ts.map