/**
 * Secure Cryptographic Utilities for Vorion
 *
 * Provides constant-time comparison and secure random generation utilities.
 * These are critical security primitives - do not modify without security review.
 *
 * @packageDocumentation
 */
/**
 * Performs a constant-time comparison of two strings or Buffers.
 *
 * CRITICAL SECURITY FUNCTION:
 * - Uses Node.js crypto.timingSafeEqual which is guaranteed constant-time
 * - No fallback implementations - fails if timingSafeEqual is unavailable
 * - Pads inputs to same length to prevent length-based timing leaks
 *
 * This function MUST be used for:
 * - Comparing authentication tokens
 * - Comparing backup codes
 * - Comparing HMAC signatures
 * - Comparing password hashes
 * - Any security-sensitive string comparison
 *
 * @param a - First value to compare (string or Buffer)
 * @param b - Second value to compare (string or Buffer)
 * @returns true if values are equal, false otherwise
 *
 * @example
 * ```typescript
 * // Compare backup codes
 * if (constantTimeEquals(inputHash, storedHash)) {
 *   // Codes match
 * }
 *
 * // Compare API tokens
 * if (constantTimeEquals(providedToken, expectedToken)) {
 *   // Token is valid
 * }
 * ```
 */
export declare function constantTimeEquals(a: string | Buffer, b: string | Buffer): boolean;
/**
 * Generates a cryptographically secure random token.
 *
 * Uses Node.js crypto.randomBytes which is backed by the OS CSPRNG.
 * The output is URL-safe base64 encoded for easy use in URLs and headers.
 *
 * @param length - Number of random bytes to generate (default: 32)
 * @returns URL-safe base64 encoded random string
 *
 * @example
 * ```typescript
 * // Generate a session token (32 bytes = 256 bits)
 * const sessionToken = generateSecureToken(32);
 *
 * // Generate a CSRF token
 * const csrfToken = generateSecureToken(24);
 *
 * // Generate an API key
 * const apiKey = generateSecureToken(48);
 * ```
 */
export declare function generateSecureToken(length?: number): string;
/**
 * Generates a cryptographically secure random hex string.
 *
 * @param length - Number of random bytes to generate (hex string will be 2x this length)
 * @returns Hex encoded random string
 *
 * @example
 * ```typescript
 * // Generate a 32-byte (256-bit) hex string (64 characters)
 * const token = generateSecureHexToken(32);
 * ```
 */
export declare function generateSecureHexToken(length?: number): string;
/**
 * Validates that a value has sufficient entropy for security purposes.
 *
 * This performs advanced entropy validation that checks for:
 * 1. Shannon entropy (character frequency distribution)
 * 2. Pattern detection (repeated sequences, keyboard patterns)
 * 3. Minimum unique character ratio
 *
 * @param value - The string to validate
 * @param minEntropyBits - Minimum required entropy in bits (default: 128)
 * @returns Object with validation result and details
 *
 * @example
 * ```typescript
 * const result = validateEntropy(userProvidedKey, 128);
 * if (!result.valid) {
 *   console.error('Key rejected:', result.reason);
 * }
 * ```
 */
export declare function validateEntropy(value: string, minEntropyBits?: number): {
    valid: boolean;
    entropyBits: number;
    reason?: string;
    warnings: string[];
};
//# sourceMappingURL=crypto-utils.d.ts.map