import { type DesMachineParams } from './NativeDesMachine'; import type { ModeEncryptionType, PaddingEncryptionType, OutputFormatType } from './NativeDesMachine'; declare const Padding: Record; declare const Mode: Record; declare const Format: Record; interface OptionsList { label: string; value: T; } declare const modeOptions: OptionsList[]; declare const paddingOptions: OptionsList[]; declare const formatOptions: OptionsList[]; /** * DES Machine class for encryption and decryption. * Supports multiple instances with different configurations. * * @example * ```typescript * // Create a machine with default settings * const machine = new DesMachine({ key: 'mySecretKey123' }); * * // Encrypt and decrypt * const encrypted = machine.encrypt('Hello World'); * const decrypted = machine.decrypt(encrypted); * * // Create another machine with custom IV for CBC mode * const cbcMachine = new DesMachine({ * key: 'anotherKey1', * iv: '12345678', // 8 characters for DES * mode: Mode.CBC, * outputFormat: Format.HEX, * }); * ``` */ declare class DesMachine { private params; /** * Create a new DES Machine instance. * @param params - Configuration parameters * @throws Error if key is missing or less than 8 characters * @throws Error if iv is provided but not exactly 8 characters */ constructor(params: DesMachineParams); /** * Encrypt plaintext using DES algorithm. * @param text - The plaintext to encrypt * @returns Encrypted string in the configured output format */ encrypt(text: string): string; /** * Decrypt ciphertext using DES algorithm. * @param text - The encrypted string to decrypt * @returns Decrypted plaintext */ decrypt(text: string): string; /** * Get the current configuration parameters. * @returns A copy of the current parameters (key and iv are masked) */ getParams(): Omit & { key: string; iv?: string; }; /** * Update configuration parameters. * @param params - New parameters to apply (key and iv cannot be changed) */ updateParams(params: Partial>): void; } /** * Create a new DES Machine instance. * @param params - Configuration parameters * @returns A new DesMachine instance * * @example * ```typescript * const machine = createDesMachine({ key: 'mySecretKey123' }); * const encrypted = machine.encrypt('Hello'); * ``` */ declare function createDesMachine(params: DesMachineParams): DesMachine; /** * Quick encrypt function for one-off encryption. * @param params - Configuration parameters including key * @param text - The plaintext to encrypt * @returns Encrypted string * * @example * ```typescript * const encrypted = encrypt({ key: 'mySecretKey123' }, 'Hello World'); * ``` */ declare function encrypt(params: DesMachineParams, text: string): string; /** * Quick decrypt function for one-off decryption. * @param params - Configuration parameters including key * @param text - The encrypted string to decrypt * @returns Decrypted plaintext * * @example * ```typescript * const decrypted = decrypt({ key: 'mySecretKey123' }, encryptedText); * ``` */ declare function decrypt(params: DesMachineParams, text: string): string; export { DesMachine, createDesMachine, encrypt, decrypt, Mode, Padding, Format, modeOptions, paddingOptions, formatOptions, }; export type { DesMachineParams, ModeEncryptionType, PaddingEncryptionType, OutputFormatType, }; //# sourceMappingURL=index.d.ts.map