import { ByteArray } from '../../types.js'; /** * Computes the Algorithm 2.B hash for PDF 2.0 AES-256 encryption. * This iterative hash algorithm uses SHA-256, SHA-384, or SHA-512 based on * intermediate results, running for at least 64 rounds. * * @param password - The user or owner password. * @param salt - The 8-byte validation or key salt. * @param userKey - The user key (required for owner password validation). Defaults to empty. * @returns A promise that resolves to a 32-byte hash. * * @example * ```typescript * const hash = await computeAlgorithm2bHash(password, salt) * ``` */ export declare function computeAlgorithm2bHash(password: ByteArray, salt: ByteArray, userKey?: ByteArray): Promise; /** * Validates a password against a stored hash using the Algorithm 2.B hash. * * @param password - The password to validate. * @param key - The stored key containing the hash (first 32 bytes) and validation salt (bytes 32-40). * @param extra - Extra data for owner password validation (user key). * @returns A promise that resolves to the computed hash if validation succeeds. * @throws Error if the password is invalid or salt/hash lengths are incorrect. * * @example * ```typescript * try { * await validatePasswordHash(password, storedKey) * console.log('Password is valid') * } catch (e) { * console.log('Invalid password') * } * ``` */ export declare function validatePasswordHash(password: ByteArray, key: ByteArray, extra?: ByteArray): Promise; /** * Retrieves the file encryption key using user or owner password. * Tries owner password first, then falls back to user password. * * @param userPassword - The user password to try. * @param ownerPassword - The owner password to try. * @param u - The 48-byte /U value from the encryption dictionary. * @param ue - The 32-byte /UE value (encrypted user key). * @param o - The 48-byte /O value from the encryption dictionary. * @param oe - The 32-byte /OE value (encrypted owner key). * @returns A promise that resolves to the 32-byte file encryption key. * @throws Error if both passwords are invalid. * * @example * ```typescript * const fileKey = await getFileKey(userPw, ownerPw, U, UE, O, OE) * ``` */ export declare function getFileKey(userPassword: ByteArray, ownerPassword: ByteArray, u: ByteArray, ue: ByteArray, o: ByteArray, oe: ByteArray): Promise;