Discuss Scratch

Wozg
New Scratcher
6 posts

A way to hide text from others

Hi! I just created an account because it seems like Scratch is good for the project I want to do. There's a problem though that might hinder me from using it.

I'm doing an internet puzzle where you complete stages. When you get to the end of a stage you get a password for the next one. (Most of the puzzle is unrelated to scratch) I'm thinking of using scratch to create a puzzle and then embed it to my webpage. The problem is that anyone can edit games made with scratch right? So they can just skip the whole thing and just look for the password in the code. So is there any way to hide a string of text so nobody else can see it?
Mmaarten
Scratcher
100+ posts

A way to hide text from others

The scratch idea is imagine program SHARE, this means that everything is public on the site. There is no way of hiding info that is used in the project
Wozg
New Scratcher
6 posts

A way to hide text from others

I can understand well that all of the code should be shared, but it's still a shame you can't hide a single word unrelated to all the code. Thank you for your help.

I've spent the morning trying to find a way to make a rather simple game to my site. I liked scratch because it wouldn't bring ads with them. If anyone can point me to somewhere, which has a tutorial on how to do this, I would be grateful.
Mmaarten
Scratcher
100+ posts

A way to hide text from others

What you could do thougs is not share the project on scratch, this way noone can see your code nor your game.

*EDIT: only the scratch team members would be able to see it

Last edited by Mmaarten (June 27, 2016 11:44:12)

awesome-llama
Scratcher
1000+ posts

A way to hide text from others

There isn't any way to completely hide information, but ways to make it hard to find/workout are:
Hide the script behind an other script.
Encode the information into another secret code, and decode when needed.
Hide it in a giant list that only you know where the info is in the list

Last edited by awesome-llama (June 27, 2016 11:44:49)

Wozg
New Scratcher
6 posts

A way to hide text from others

Mmaarten wrote:

What you could do thougs is not share the project on scratch, this way noone can see your code nor your game.

*EDIT: only the scratch team members would be able to see it


Will I be able to put it into my website without it being also putting it on scratch website? Like directly put it into the website and not embed it. Not sure if know how scratch works exactly.
TheLogFather
Scratcher
1000+ posts

A way to hide text from others

You can use (one-way) encryption for this.

What you do is take a known string (which would be visible in the project) and encrypt it in some way using the password. This gives you an encrypted string, which would also be visible in the project.

When someone enters a password, you would use that to encrypt the original known string, and compare the result to what it should be for the correct password. They should only match if the password is correct.

The password is never shown in the project.

Here's an example project that uses such a method:


https://scratch.mit.edu/projects/24370770/

(You might want to use a simpler form of encryption, though – what I did there was a bit complex…)

Last edited by TheLogFather (June 27, 2016 11:56:13)

Wozg
New Scratcher
6 posts

A way to hide text from others

Thanks TheLogfather. From what I understand of it, very clever. It don't think it can help me though? Maybe I explained it badly, but I want the player to complete the game made in scratch and then get the password from it. Then with the password they get they will be able to continue on in the internet puzzle.

What yours basically does is that it checks if a password is correct, but doesn't tell what the password is, right?
TheLogFather
Scratcher
1000+ posts

A way to hide text from others

Wozg wrote:

Thanks TheLogfather. From what I understand of it, very clever. It don't think it can help me though? Maybe I explained it badly, but I want the player to complete the game made in scratch and then get the password from it. Then with the password they get they will be able to continue on in the internet puzzle.

What yours basically does is that it checks if a password is correct, but doesn't tell what the password is, right?
Ah, I see, of course – you're actually wanting to hand out the password in-game and then use that for the next stage (which is on your website, rather than on Scratch, is that right…?)

OK, no, there isn't an easy way to do such a thing. I've considered how to do this kind of thing before, and it involves writing a custom cloud client which would communicate with the project through messages secured through double-key encryption.

Writing a custom cloud client isn't so hard if you have some python or javascript knowledge, though it can be a bit tricky to make it robust.

Let me know if you want more info…

Last edited by TheLogFather (June 27, 2016 14:40:39)

Wozg
New Scratcher
6 posts

A way to hide text from others

TheLogFather wrote:

Wozg wrote:

Thanks TheLogfather. From what I understand of it, very clever. It don't think it can help me though? Maybe I explained it badly, but I want the player to complete the game made in scratch and then get the password from it. Then with the password they get they will be able to continue on in the internet puzzle.

What yours basically does is that it checks if a password is correct, but doesn't tell what the password is, right?
Ah, I see, of course – you're actually wanting to hand out the password in-game and then use that for the next stage (which is on your website, rather than on Scratch, is that right…?)

OK, no, there isn't an easy way to do such a thing. I've considered how to do this kind of thing before, and it involves writing a custom cloud client which would communicate with the project through messages secured through double-key encryption.

Writing a custom cloud client isn't so hard if you have some python of javascript knowledge, though it can be a bit tricky to make it robust.

Let me know if you want more info…


Yes you are correct. Player completes the scratch game and gets password from it which is then used somewhere else (not scratch involved). Very interesting to hear something like that could be made, but it would probably be better for me to just use something other than scratch. Probably will be easier (and also good in the long run) for me to start learning a code language and do it that way.

Thanks for the help!


Brontosplachna
Scratcher
100+ posts

A way to hide text from others

How about if the password is the answer to the puzzle or otherwise derived from solving the puzzle? If the puzzle was unscrambling letters to make a word, the password would be the resulting word. Or the password could be “the longest word hidden in this word search puzzle” or “the minimum number of turns needed to solve this maze”, etc. The password is never stated in the code. Of course it all depends on the particular puzzle.





Wozg
New Scratcher
6 posts

A way to hide text from others

Brontosplachna wrote:

How about if the password is the answer to the puzzle or otherwise derived from solving the puzzle? If the puzzle was unscrambling letters to make a word, the password would be the resulting word. Or the password could be “the longest word hidden in this word search puzzle” or “the minimum number of turns needed to solve this maze”, etc. The password is never stated in the code. Of course it all depends on the particular puzzle.







Yep, it could be done that way. But unfortunately doesn't help in what I have in mind.
858master
Scratcher
30 posts

A way to hide text from others

I know how, just make a encoder and decoder for Text, not cloud list, and after that, set the code to the username encoded, that will fix so only the user who has getten the code can use it
Encode the username
Give it to the player
Decode it in the next level
aste5658
New Scratcher
1 post

A way to hide text from others

858master wrote:

I know how, just make a encoder and decoder for Text, not cloud list, and after that, set the code to the username encoded, that will fix so only the user who has getten the code can use it
Encode the username
Give it to the player
Decode it in the next level

So… How exactly do you make these Blocks? I cannot find them.
deck26
Scratcher
1000+ posts

A way to hide text from others

aste5658 wrote:

858master wrote:

I know how, just make a encoder and decoder for Text, not cloud list, and after that, set the code to the username encoded, that will fix so only the user who has getten the code can use it
Encode the username
Give it to the player
Decode it in the next level

So… How exactly do you make these Blocks? I cannot find them.
They don't exist, that's just a list of necessary tasks. It would only work to control access to a new level within one project so isn't an answer to the original question.
MiaM20
Scratcher
3 posts

A way to hide text from others

o
deck26
Scratcher
1000+ posts

A way to hide text from others

MiaM20 wrote:

o
Please don't spam or necropost.
KevinCreator_Test
Scratcher
34 posts

A way to hide text from others

In “text” are a code to make it:

when green flag clicked 
if <(username) = [Random]> then
say [Hi User Lol]

else

end
In “else” put your “normal” scripts

Last edited by KevinCreator_Test (May 21, 2020 05:02:24)

KevinCreator_Test
Scratcher
34 posts

A way to hide text from others

KevinCreator_Test wrote:

In “text” are a code to make it:

when green flag clicked 
if <(username) = [Random]> then
say [Hi User Lol]

else

end
In “else” put your “normal” scripts
Omg i didn't read the text well
Monna-Uka
Scratcher
1000+ posts

A way to hide text from others

KevinCreator_Test wrote:

KevinCreator_Test wrote:

In “text” are a code to make it:

when green flag clicked 
if <(username) = [Random]> then
say [Hi User Lol]

else

end
In “else” put your “normal” scripts
Omg i didn't read the text well
Please. Don't. Necropost.

Powered by DjangoBB