UNPKG

node-ciphers

Version:

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

19 lines (18 loc) 821 B
import { BaseCipherEncodingOptions } from "./options.js"; import { Except } from "type-fest"; //#region src/types/aes.d.ts type AesCipherAlgorithm = `aes-${128 | 192 | 256}-${AesCipherMode}`; type AesCipherMode = 'cbc' | 'ccm' | 'cfb1' | 'cfb8' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ofb'; interface HasAuthTagAesCipherEncodingOptions extends BaseCipherEncodingOptions { /** * @default 'hex' */ authTag?: BufferEncoding; } declare namespace HasAuthTagAesCipherEncodingOptions { type Decrypt = Except<HasAuthTagAesCipherEncodingOptions, 'encryptInput' | 'encryptOutput' | 'key'>; type Encrypt = Except<HasAuthTagAesCipherEncodingOptions, 'decryptInput' | 'decryptOutput' | 'key'>; } //#endregion export { AesCipherAlgorithm, AesCipherMode, HasAuthTagAesCipherEncodingOptions }; //# sourceMappingURL=aes.d.ts.map