node-ciphers
Version:
Lightweight AES and DES encryption library for Node.js, featuring flexible encoding, multiple cipher modes, and TypeScript support.
25 lines • 1.59 kB
TypeScript
import type { BinaryLike } from 'node:crypto';
import type { TransformOptions } from 'node:stream';
import type { HasAuthTagAesCipherEncodingOptions, Result } from '../types';
import { BaseAesCipher } from './base';
type AvailableIvLength = 7 | 8 | 9 | 10 | 11 | 12 | 13;
export 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;
}>;
}
export {};
//# sourceMappingURL=ccm.d.ts.map