/** * Crypto Security Utilities * * Additional security measures for cryptographic operations: * - Memory protection (secure buffer zeroing) * - Session integrity verification (HMAC-based) */ /** * Securely zero a buffer's contents to prevent key material from * lingering in memory after use. * * Note: This provides best-effort protection. JavaScript's garbage * collector may still retain copies of sensitive data in memory. * For maximum security, use native crypto libraries that handle * key material in secure memory regions. */ export declare function secureZeroBuffer(buffer: Buffer): void; /** * Create an HMAC of the session file path using the encryption key. * This is used to detect if a session file has been moved/copied * to a different location (potential tampering or session theft). * * @param sessionPath - Absolute path to the session file * @param key - The encryption key (32 bytes) * @returns HMAC as hex string */ export declare function createSessionHmac(sessionPath: string, key: Buffer): string; /** * Verify that a session file is in its original location by * comparing the stored HMAC with a freshly computed one. * * Uses timing-safe comparison to prevent timing attacks. * * @param sessionPath - Current absolute path to the session file * @param key - The encryption key (32 bytes) * @param storedHmac - The HMAC that was stored with the session * @returns true if the session is in its original location */ export declare function verifySessionIntegrity(sessionPath: string, key: Buffer, storedHmac: string): boolean; //# sourceMappingURL=crypto-security.d.ts.map