PageCrypt Documentation

repository·master·Indexed 20 days ago

https://github.com/lupine-dev/pagecrypt

A client-side tool for password-protecting HTML files using strong encryption without server-side infrastructure. Includes a PowerShell CLI using .NET encryption libraries and a Python CLI utilizing pycryptodome and pbkdf2 for AES encryption.

Tokens
842
Snippets
4
Records
6
Agent score
70%

What's inside PageCrypt

  1. Overview of PageCrypt

    master

    PageCrypt is a tool designed to securely password-protect HTML files. It is unique because it operates entirely client-side using JavaScript, meaning there are no server-side components required to manage or serve the protected content. It utilizes strong encryption to ensure that the password protection cannot be bypassed.

    For detailed instructions and to use the tool, visit the official Project Page.

  2. Encrypt an HTML file via the PageCrypt CLI

    master

    Use the encrypt.py script to password-protect an HTML file.

    Arguments:

    1. filename (Mandatory): The path to the HTML file you want to encrypt.
    2. [passphrase] (Optional): The password for the file. If you omit this argument, the script will prompt you to enter a passphrase securely during execution.

    Example usage:

    # Encrypting with a passphrase provided as an argument
    python3 encrypt.py my_page.html my_secret_password
    
    # Encrypting and being prompted for a passphrase manually
    python3 encrypt.py my_page.html
  3. Use the PageCrypt PowerShell CLI to encrypt text or files

    master

    PageCrypt provides a PowerShell script to securely password-protect HTML files using .NET encryption libraries.

    Setup Requirements:

    1. Ensure the script Encrypt-StaticHTML.ps1 and the template decryptTemplate-legacy.html are located in the same directory.

    Encryption Tasks:

    • Encrypt a raw string: Use the -Text parameter to pass the content you want to encrypt.
    • Encrypt an existing file: Use the -File parameter to specify the HTML file you want to protect.
    # To encrypt a string of text
    .\Encrypt-StaticHTML.ps1 -Text '--text to encrypt--' -Password '--encryption password--'
    
    # To encrypt a file
    .\Encrypt-StaticHTML.ps1 -File example.html -Password '--encryption password--'
  4. Install PageCrypt Python dependencies

    master

    To use the PageCrypt CLI, you must install the required Python dependencies using pip3. This includes pycryptodome for AES encryption and pbkdf2 for key derivation.

    Ensure you have Python3 and Pip3 installed on your system before running the installation command.

    pip3 install -r requirements.txt
  5. Reference PageCrypt PowerShell CLI parameters

    master

    The Encrypt-StaticHTML.ps1 script accepts the following parameters for controlling the encryption process.

    Mandatory:
    `Password` = key password
    `Text` = text to encrypt, or
    `File` = file to encrypt
    
    Optional:
    `Template` = Custom template location
    `OutFile` = Destination file
    `KeySize` = AES key size (default 32 bytes)
    `Iterations` = Hash iterations (default 100)