Environment Secrets?

A variable that only the creator can see the value of. If any of you guys have heard of or use REPL, you'll know what I'm talking about. The way it would work is when the user makes a new variable, there is the option for it to be local, global, or (the new part:) secret. If the user selects "secret" then a new menu is shown to set this variable to a value. Boom! Now the creator can use this variable to store a password of some sort inside their project! Now when someone wants to see the creator's code, they can see the variable block but it has a lock image next to it. Sort of like how Scratch Cloud vars have a cloud. And if the user clicks on it, it will report nothing. If the user decides to remix the project the vars will be set to blank and the remixer must set them to their values.

Edit to add some.
Issues:

  • You can still use JS to find their values.

Ill try to make a "secrets" thing for Snap!

The variable can only be obfuscated and not 100% hidden because it would be clientside which the user can control.

Maybe a way to encode it when Snap! stores it inside metadata.

@helicoptur I didn't think of

Maybe

so users can't find it?

How would you encrypt it while storing the key(s) safely?

I don't know...

In fact, it is not possible. There is no way to tell if the variable is being used by the website, or if it is being used by a firefox extension. It would be possible to make variables which are hidden, but that will only encourage bad security practices without adding anything. If you want encryption though, and have somewhere to store the keys, making a JS accelerated library could be very fast and secure.

Bump? I would really like this to happen.

I had made it, but I deleted it. (For a reason. Don't ask me why. I wont answer.)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.