import { IEncryptionStrategy, EncryptionResult, DecryptionParams } from '../encryption-strategy.interface'; /** * XChaCha20-Poly1305 Encryption Strategy * * SOLID Principles: * - Single Responsibility: Handles XChaCha20-Poly1305 encryption/decryption * - Open/Closed: Implements IEncryptionStrategy interface * - Liskov Substitution: Can substitute any IEncryptionStrategy * - Interface Segregation: Focused interface * - Dependency Inversion: Depends on IEncryptionStrategy abstraction * * Algorithm Details: * - XChaCha20-Poly1305 is an extended nonce variant of ChaCha20-Poly1305 * - XChaCha20: Extended nonce stream cipher (192-bit nonce) * - Poly1305: Message authentication code * - Advantages over ChaCha20-Poly1305: * * 192-bit nonce (vs 96-bit) allows random nonce generation without collision risk * * Better for scenarios where nonce management is difficult * * Used in modern protocols like WireGuard * - 256-bit key, 192-bit nonce (IV) */ export declare class XChaCha20Poly1305Strategy implements IEncryptionStrategy { readonly algorithmName = "XChaCha20-Poly1305"; readonly isSupported = true; readonly requiresExternalLibrary = true; private readonly PBKDF2_ITERATIONS; private readonly KEY_LENGTH; private readonly IV_SIZE; private readonly SALT_SIZE; /** * Get recommended IV (nonce) size */ getIvSize(): number; /** * Get recommended salt size */ getSaltSize(): number; /** * Encrypt data using XChaCha20-Poly1305 */ encrypt(data: ArrayBuffer, password: string, saltHex: string, ivHex: string): Promise; /** * Decrypt data using XChaCha20-Poly1305 */ decrypt(params: DecryptionParams): Promise; /** * Derive encryption key from password using PBKDF2 * * PBKDF2 (Password-Based Key Derivation Function 2): * - Derives a cryptographic key from a password * - Uses salt to prevent rainbow table attacks * - Uses iterations to slow down brute-force attacks * - NIST approved (FIPS 140-2) */ private deriveKey; /** * Convert hex string to Uint8Array */ private hexToUint8Array; } //# sourceMappingURL=xchacha20-poly1305-strategy.d.ts.map