UNPKG

node-ciphers

Version:

Lightweight AES and DES encryption library for Node.js, featuring flexible encoding, multiple cipher modes, and TypeScript support.

29 lines (28 loc) 1.63 kB
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/ccm.d.ts type AvailableIvLength = 7 | 8 | 9 | 10 | 11 | 12 | 13; declare class Ccm extends BaseAesCipher<HasAuthTagAesCipherEncodingOptions> { #private; constructor(key: BinaryLike, encodingOptions?: HasAuthTagAesCipherEncodingOptions, authTagLength?: number, ivLength?: AvailableIvLength); 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?: AvailableIvLength, encodingOptions?: HasAuthTagAesCipherEncodingOptions.Encrypt, cipherOptions?: TransformOptions): Result<{ authTag: string; authTagLength: number; data: string; iv: string; }>; encryptJson(data: any, authTagLength?: number, ivLength?: AvailableIvLength, encodingOptions?: HasAuthTagAesCipherEncodingOptions.Encrypt, cipherOptions?: TransformOptions): Result<{ authTag: string; authTagLength: number; data: string; iv: string; }>; } //#endregion export { Ccm }; //# sourceMappingURL=ccm.d.ts.map