pagecrypt
Version:
Easily add client-side password-protection to your Single Page Applications, static websites and HTML files.
14 lines (13 loc) • 845 B
TypeScript
import { generatePassword, encryptHTML } from './core';
/**
* Encrypt a HTML file with a given password.
* The resulting page can be viewed and decrypted by opening the output HTML file in a browser, and entering the correct password.
*
* @param {string} inputFile The filename (or path) to the HTML file to encrypt.
* @param {string} outputFile The filename (or path) where the encrypted HTML file will be saved.
* @param {string} password The password used to encrypt + decrypt the content.
* @param {number} iterations The number of iterations to derive the key from the password.
* @returns A promise that will resolve when the encrypted file has been saved.
*/
declare function encrypt(inputFile: string, outputFile: string, password: string, iterations?: number): Promise<void>;
export { encrypt, generatePassword, encryptHTML };