r/HTML • • Oct 07 '26

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 comment

0

u/hals-memorybank Oct 07 '26

I have to present something to someone outside our company, and was hopping do it with via html.
We usually just print the excel model into PDF but i was hoping for something more interactive where they could play with the financial model.
I guess its not very feasible

6

u/jbergens Oct 07 '26

Write all logic on the server side.

2

u/rileywbaker Oct 07 '26

In that case, why would it be important for the HTML to not be editable?

1

u/hals-memorybank Oct 07 '26

I’m new to html coding, but as far as i can tell i’d have to write in the some of financial models we use into the html, and we’re not allowed to share those models out of house.
Literally a giant red banner on the excel fromt page saying do not share

8

u/BobJutsu Oct 07 '26

Yeah…don’t do that. You’re getting into frontend security at this point, so the data needs to have a backend to keep it secure. Well beyond “html”. Now you are talking a whole ass app.

4

u/Adamstrad Oct 07 '26

You need to use server-side code to hide the logic, ask chatgpt about how php language can help, don't put any secrets in html it's the public facing code

1

u/blktndr Oct 07 '26

Also don’t put any secrets in ChatGPT whilst asking about how to put secrets in php

2

u/rileywbaker Oct 07 '26

Don't put the model in the HTML, just the data the model output that you want to show the client. The same data that would go in a PDF.

1

u/Towel_Affectionate Oct 07 '26

Well by putting everything inside a single HTML file and sharing it you would literally expose it to the world. You need to keep all the secret stuff on the server inside the house, and share only the entry point (interface to play around with the inputs + end result).

0

u/rackodo Oct 07 '26

turn the webpage into a PDF file?

1

u/tomysshadow Oct 07 '26

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 Oct 13 '26

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.

1

u/Puzzleheaded6905 Oct 07 '26

Oh you host it on a website, then it can’t be modified.