Is there a way to password protect HTML pages without using a server side language?

后端 未结 10 1698
情深已故
情深已故 2021-01-14 14:36

I have a series of interlinked web pages, and I want to restrict access to these pages by asking the user to provide a login and password. However, my hosting account curren

10条回答
  •  粉色の甜心
    2021-01-14 14:51

    Below is a working solution to this problem that uses encryption, which I implemented myself.

    A few users here have suggested using an encryption-based approach to client-side password protection. I needed this functionality too, so I implemented it myself. The password is hashed using PBKDF2 and then used to encrypt the page with AES256.

    The tool is hosted here:

    https://www.maxlaumeister.com/pagecrypt/

    with source code available here:

    https://github.com/MaxLaumeister/pagecrypt


    Description of the project, from the project page:

    PageCrypt - Password Protect HTML

    This tool lets you securely password-protect an HTML file. Unlike other password-protection tools, this tool:

    1. Has no server-side components (this tool and its password-protected pages run entirely in javascript).

    2. Uses strong encryption, so the password-protection cannot be bypassed.

    All you need to do is choose an HTML file and a password, and your page will be password-protected.

提交回复
热议问题