import { TurboModuleRegistry, type TurboModule } from 'react-native'; export type ModeEncryptionType = 'ECB' | 'CBC' | 'CFB' | 'OFB' | 'CTR'; export type PaddingEncryptionType = 'PKCS7' | 'ISO10126' | 'ZERO' | 'NONE'; export type OutputFormatType = 'BASE64' | 'HEX'; export interface DesMachineParams { /** * Encryption key (minimum 8 characters) */ key: string; /** * Initialization Vector for non-ECB modes (exactly 8 characters) * If not provided, the first 8 bytes of the key will be used as IV */ iv?: string; /** * Cipher mode (default: ECB) */ mode?: ModeEncryptionType; /** * Padding scheme (default: PKCS7) */ padding?: PaddingEncryptionType; /** * Output format (default: BASE64) */ outputFormat?: OutputFormatType; } export interface Spec extends TurboModule { /** * Encrypt text with provided params (stateless operation) */ encrypt(params: DesMachineParams, text: string): string; /** * Decrypt text with provided params (stateless operation) */ decrypt(params: DesMachineParams, text: string): string; } export default TurboModuleRegistry.getEnforcing('DesMachine');