r/HTML • u/Mr_pisser • Sep 26 '26
Question Coding passwords/answers in HTML (for Google sites)?
hi! apologies if this isn’t the right sub and I’m not even sure if this is possible- but here goes
i like to mess around and make fun little artsy sites and such on Google sites and I’m working on a personal project that I was hoping to add a cool password feature in. Let me explain though because it’s a bit complicated what I want-
so, basically what I want is to have a little text box that people can type in- there’d be preset passwords you can use that will either redirect you places, show you images, text docs, etc etc- an example is https://thisisnotawebsitedotcom.com/ (I know all the passwords for this arg so just for an example type in “blind eye”)
I don’t need the things it shows to be affixed to any certain place I‘d just want it to pop up either on screen or in a new tab- it’s for story/ARG purposes.
this wouldn’t be the users setting a password- it’s basically having a handful of words and phrases that trigger things to happen that people viewing the website can type in for the things to happen
is this something I can execute in Google sites using HTML? any pointers to any pre existing coded templates or instructions on how to code it myself (I know limited HTML so I think I could if I knew what commands to run) would be appreciated!
(I’m not going to use AI for any part of this either artistically or for coding- please do not use AI to “assist” me and please do not recommend it. I’m not here to bully anyone who does use AI, but I’m very against it and won’t be utilising it. I’m here to utilise the good ol’ human brain for this project :))
6
u/Aggressive_Ad_5454 Sep 26 '26
This sounds like some good old retro web fun. Make sure one of your links points to an image of a toy duck on rollers. 😇 https://en.wiktionary.org/wiki/duckroll
If you are willing to have your audience be able to see the passwords if they do View Source in your browser, just hard code them in your Javascript program.
If you need to make the passwords hard to guess by people who do View Source on your page, you can hash them with bcrypt.hash and store the hash in your Javascript program. You can then check the user input with bcrypt.checkPassword. Read this for more info. https://compile7.org/hashing/how-to-use-bcrypt-in-javascript-in-browser/#setting-up-bcrypt-in-the-browser
3
u/-svde- Sep 26 '26
i know it’s not a security thing, but if you want people to not be able to just inspect the source and get the passwords then you would need to serve the entry portal via backend rather than just pure frontend js/html.
if you are using google sites, i believe you are restricted to using frontend code in their embed widgets, though you could technically pass it through server side via a google apps script fetch() request that the javascript calls on the site page.
alternatively you could also use a third party API, plenty of free options including their own firebase, or you could also host the password input function entirely on a different platform that would give you more flexibility and control and inject it as an iframe on the google site.
i’m out & on mobile so i can’t effectively link to any tutorials at the moment but if you can clarify exactly how you want the password thing to function i can at least point you in the right direction
2
u/VoiceOfSoftware Sep 26 '26
For the scale of fun project you're describing, the absolute simplest way to 'hide' content from people who don't know the password is to name your hidden-content HTML pages the same as the password, and redirect people to whatever they type into the input box.
Please enter password: [super-secret-password]
Web page on your site: super-secret-password.html
Javascript code when someone types text and hits enter: redirect to whatever-they-typed.html
This has the added benefit of not having to hide your passwords in inspectable code, and you can add new pages later without re-deploying.