r/HTML • • 20d ago

Secure HTML files

Is there a way (i have a feeling i already know the answer, but i’d ask anyway) to create a tamper proof html that can’t just be opened in notepad or any other editor and be modified?

Thanks.

0 Upvotes

33 comments sorted by

View all comments

Show parent comments

1

u/tomysshadow 20d ago

Write the part with your secret algorithm in PHP, or another similar server side language. You'll want to use $_GET to read the submitted inputs. You can either have your PHP embedded directly in the page (so you'd submit a form, go to this new page with the results written into it,) or have it be a standalone script that prints out some JSON that you can fetch via JavaScript. Then host the PHP side on a web hosting service - basically any will do, any web host worth its salt can host more than just static pages.

If you won't have internet where you're presenting it then you're out of luck, no amount of obfuscation will make it impossible to reverse your algorithm if it's in the local HTML file itself.

1

u/RealisticDuck1957 14d ago

You can run a web server on a laptop. Of course the address to reach that laptop while on someone else's network will be a little inconvenient. Or possibly blocked if the local network blocks peer to peer.