import { IEncryptionStrategy, EncryptionResult, DecryptionParams } from '../encryption-strategy.interface'; /** * ChaCha20-Poly1305 Encryption Strategy * * SOLID Principles: * - Single Responsibility: Handles ChaCha20-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: * - ChaCha20-Poly1305 is an authenticated encryption algorithm * - ChaCha20: Stream cipher (developed by Daniel J. Bernstein) * - Poly1305: Message authentication code * - Used in TLS 1.3, WireGuard, Signal Protocol * - Faster than AES on devices without hardware AES acceleration * - 256-bit key, 96-bit nonce (IV) */ export declare class ChaCha20Poly1305Strategy implements IEncryptionStrategy { readonly algorithmName = "ChaCha20-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 ChaCha20-Poly1305 */ encrypt(data: ArrayBuffer, password: string, saltHex: string, ivHex: string): Promise; /** * Decrypt data using ChaCha20-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=chacha20-poly1305-strategy.d.ts.map