UNPKG

node-ciphers

Version:

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

22 lines (16 loc) 853 B
import type { Except } from 'type-fest'; import type { BaseCipherEncodingOptions } from './options'; export type { BaseCipherEncodingOptions as AesCipherEncodingOptions } from './options'; export type AesCipherAlgorithm = `aes-${128 | 192 | 256}-${AesCipherMode}`; export type AesCipherMode = 'cbc' | 'ccm' | 'cfb1' | 'cfb8' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ofb'; export interface HasAuthTagAesCipherEncodingOptions extends BaseCipherEncodingOptions { /** * @default 'hex' */ authTag?: BufferEncoding; } // eslint-disable-next-line ts/no-namespace export namespace HasAuthTagAesCipherEncodingOptions { export type Decrypt = Except<HasAuthTagAesCipherEncodingOptions, 'encryptInput' | 'encryptOutput' | 'key'>; export type Encrypt = Except<HasAuthTagAesCipherEncodingOptions, 'decryptInput' | 'decryptOutput' | 'key'>; }