This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-04-18 14:53:58

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Scratch Cryptography

So as many of you may know, encryption isn't one of the easiest things in Scratch. And since my Chat.PY project has absolutely no security between Scratch and my server. Many of you may also know that very few things on the internet are secure as well. Many websites on the internet with a login system send the users' passwords from their browser to the web server insecurely (just as insecurely as any message sent in Mesh for those of you that want to compare security).

What I want to do with this collab, is try to get people together to create security and help them implement security in their projects and teach them to remember security in all their future projects. Mostly online projects, since there is almost no reason to implement security in normal Scratch projects.

A quote once said "Cook the blueberries in the muffins, don't add them after," where security could be considered the blueberries.

----

So I think the first goal is to make a simple encryption program in Scratch. Maybe a shift-cipher? Once we get a base made I think we should find a way to make it more efficient and faster.  smile

We want all the ciphers to be easily implementable for any project that wants it. So we should keep it to a single sprite.  smile

----

Examples:
Hashing: http://scratch.mit.edu/projects/Magnie/2276843

----

Competitions, make the fastest and most efficient cipher in Scratch!

Shift Cipher - Have it shift the letters to a different position based on the key provided by the user (the key can be just numbers, or it can use letters as part of the key).

Substitution Cipher - Have one letter replace another based on the key provided by the user.

Hashing - Create a one way encryption (hash). An example is provided here.

Rule: Keep the cipher script in a single sprite.

Feel free to collaborate or do it on your own! Currently there isn't any deadline. The official chat room for this is 'crypt' (no quotes) on Chat.PY. The official gallery is here.

----

Collaborative Projects:
Secure Mesh - Status:
Key Exchange [%33.3] (Phases: Find an algorithm, Script the algorithm, Test the script, Test it with a server, Polish it, Fully implement)
Symmetric Encryption [%0] (Phases: Find an algorithm, Script the algorithm, Test the script, Implement it with Key Exchange, Test with Server, Polish it, Fully implement)

Last edited by Magnie (2012-04-26 20:20:39)

Offline

 

#2 2012-04-20 03:31:36

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Scratch Cryptography

Why do encryption in Scratch at all? For example, for chat.py, couldn't you just have your Python mirror make a secure connection to the server? That would seem to make a lot more sense practically; it'd be faster and probably more secure, too.  smile

(Just ruining your fun here...  tongue )

Last edited by blob8108 (2012-04-20 03:32:15)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#3 2012-04-20 06:17:58

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch Cryptography

blob8108 wrote:

Why do encryption in Scratch at all? For example, for chat.py, couldn't you just have your Python mirror make a secure connection to the server? That would seem to make a lot more sense practically; it'd be faster and probably more secure, too.  smile

(Just ruining your fun here...  tongue )

We could, but now Scratch Space (and soon FireMMO) supports direct-mesh. So there isn't much security.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#4 2012-04-20 12:51:36

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

bobbybee wrote:

blob8108 wrote:

Why do encryption in Scratch at all? For example, for chat.py, couldn't you just have your Python mirror make a secure connection to the server? That would seem to make a lot more sense practically; it'd be faster and probably more secure, too.  smile

(Just ruining your fun here...  tongue )

We could, but now Scratch Space (and soon FireMMO) supports direct-mesh. So there isn't much security.

Yeah, what you said.

It's easier to directly connect to Scratch Space with Mesh than to open Scratch, enable remote connections, open the Python program which then connects to Scratch and the server. Besides, just encrypting the passwords sent might be better than encrypting everything sent. Who knows.  tongue

Offline

 

#5 2012-04-20 13:50:31

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Scratch Cryptography

Magnie wrote:

It's easier to directly connect to Scratch Space with Mesh than to open Scratch, enable remote connections, open the Python program which then connects to Scratch and the server. Besides, just encrypting the passwords sent might be better than encrypting everything sent. Who knows.  tongue

I thought you had to shift-click "R" to enable Mesh? Which is much more work than enabling remote sensor connections...  tongue

I see your point, though. Perhaps mod Scratch to create a secure Mesh? That would be cool...


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#6 2012-04-20 14:11:44

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

blob8108 wrote:

Magnie wrote:

It's easier to directly connect to Scratch Space with Mesh than to open Scratch, enable remote connections, open the Python program which then connects to Scratch and the server. Besides, just encrypting the passwords sent might be better than encrypting everything sent. Who knows.  tongue

I thought you had to shift-click "R" to enable Mesh? Which is much more work than enabling remote sensor connections...  tongue

I see your point, though. Perhaps mod Scratch to create a secure Mesh? That would be cool...

Technically you only need to do it once. So it isn't that much work.  smile

But the goal is to make Secure Mesh as portable as possible. Asking a user to download or mod code themselves beyond normal Mesh may be beyond their limits.

Last edited by Magnie (2012-04-20 14:13:09)

Offline

 

#7 2012-04-20 15:56:15

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Scratch Cryptography

Magnie wrote:

Technically you only need to do it once. So it isn't that much work.  smile

True, true...  smile

But the goal is to make Secure Mesh as portable as possible. Asking a user to download or mod code themselves beyond normal Mesh may be beyond their limits.

I was thinking of a Flash/Java player mod with Mesh enabled, which could also have a secure (SSL?) option, too. I see your point, though; you do want it to be easy.

Your conclusion is correct, then! Cryptography in pure Scratch is indeed what you need. I'm sorry I interrupted — do carry on...


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#8 2012-04-21 19:44:48

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Scratch Cryptography

Magnie wrote:

blob8108 wrote:

Magnie wrote:

It's easier to directly connect to Scratch Space with Mesh than to open Scratch, enable remote connections, open the Python program which then connects to Scratch and the server. Besides, just encrypting the passwords sent might be better than encrypting everything sent. Who knows.  tongue

I thought you had to shift-click "R" to enable Mesh? Which is much more work than enabling remote sensor connections...  tongue

I see your point, though. Perhaps mod Scratch to create a secure Mesh? That would be cool...

Technically you only need to do it once. So it isn't that much work.  smile

But the goal is to make Secure Mesh as portable as possible. Asking a user to download or mod code themselves beyond normal Mesh may be beyond their limits.

Not beyond my limits.  I'll download just about anything...


http://i.imgur.com/BAEgGDL.png

Offline

 

#9 2012-04-21 20:11:47

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

GeonoTRON2000 wrote:

Magnie wrote:

blob8108 wrote:


I thought you had to shift-click "R" to enable Mesh? Which is much more work than enabling remote sensor connections...  tongue

I see your point, though. Perhaps mod Scratch to create a secure Mesh? That would be cool...

Technically you only need to do it once. So it isn't that much work.  smile

But the goal is to make Secure Mesh as portable as possible. Asking a user to download or mod code themselves beyond normal Mesh may be beyond their limits.

Not beyond my limits.  I'll download just about anything...

But it's easier to modify something you already have downloaded than to download something made by another user (which could be potentially harmful), isn't it?

Offline

 

#10 2012-04-21 20:13:43

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch Cryptography

Magnie wrote:

GeonoTRON2000 wrote:

Magnie wrote:


Technically you only need to do it once. So it isn't that much work.  smile

But the goal is to make Secure Mesh as portable as possible. Asking a user to download or mod code themselves beyond normal Mesh may be beyond their limits.

Not beyond my limits.  I'll download just about anything...

But it's easier to modify something you already have downloaded than to download something made by another user (which could be potentially harmful), isn't it?

Plus not everyone has the knowledge to do so.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#11 2012-04-21 20:24:59

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

bobbybee wrote:

Magnie wrote:

GeonoTRON2000 wrote:


Not beyond my limits.  I'll download just about anything...

But it's easier to modify something you already have downloaded than to download something made by another user (which could be potentially harmful), isn't it?

Plus not everyone has the knowledge to do so.

Or the ability. I know some people block downloading and stuff. But of course everything here is probably only going to be in Scratch, so squeak stuff other than Mesh probably.

Offline

 

#12 2012-04-21 20:25:49

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch Cryptography

Magnie wrote:

bobbybee wrote:

Magnie wrote:


But it's easier to modify something you already have downloaded than to download something made by another user (which could be potentially harmful), isn't it?

Plus not everyone has the knowledge to do so.

Or the ability. I know some people block downloading and stuff. But of course everything here is probably only going to be in Scratch, so squeak stuff other than Mesh probably.

Let's get back on topic, shall we?


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#13 2012-04-21 20:51:38

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

bobbybee wrote:

Magnie wrote:

bobbybee wrote:


Plus not everyone has the knowledge to do so.

Or the ability. I know some people block downloading and stuff. But of course everything here is probably only going to be in Scratch, so squeak stuff other than Mesh probably.

Let's get back on topic, shall we?

Technically we are on topic since we are discussing how we could implement Secure Mesh.  tongue

Offline

 

#14 2012-04-23 15:35:14

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

Okay, so after reading a small bit about Key-Exchange Algorithms, I think the simplest way is with this method. We could create a script that repeats the method multiple times (8 for most efficient, but secure) and then convert the integers returned into letters.

I think the next step is creating a symmetric algorithm that can't be easily broken, but can still be used for a secure Mesh. Something people would be willing to transfer useful, but not important passwords over. Like a user account to a desktop computer that is only accessible by family and close friends.

Obviously a shift-cipher wouldn't be secure enough. So what ideas do you guys have?

Make sure to keep it to simple math algorithms like: Plain Text > letter'i * key'i > Cipher Text. i symbolizes which letter. So something like Letter 1 (or letter 'i') of "secret message".

Last edited by Magnie (2012-04-23 15:35:54)

Offline

 

#15 2012-04-23 17:24:30

Nathanator1416J
Scratcher
Registered: 2012-02-21
Posts: 100+

Re: Scratch Cryptography

Magnie wrote:

Okay, so after reading a small bit about Key-Exchange Algorithms, I think the simplest way is with this method. We could create a script that repeats the method multiple times (8 for most efficient, but secure) and then convert the integers returned into letters.

I think the next step is creating a symmetric algorithm that can't be easily broken, but can still be used for a secure Mesh. Something people would be willing to transfer useful, but not important passwords over. Like a user account to a desktop computer that is only accessible by family and close friends.

Obviously a shift-cipher wouldn't be secure enough. So what ideas do you guys have?

Make sure to keep it to simple math algorithms like: Plain Text > letter'i * key'i > Cipher Text. i symbolizes which letter. So something like Letter 1 (or letter 'i') of "secret message".

I've Made a ton of encrypt dlls in VB.NET, so you could use one of those if you want.
Contact me at nathansaint1@gmail.com


http://wiki.scratch.mit.edu/images/Ptp.gif PEPPERTREE  Productions (PtP)
Tourmaline Scientific Research Programs

Offline

 

#16 2012-04-23 17:32:53

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

Nathanator1416J wrote:

Magnie wrote:

Okay, so after reading a small bit about Key-Exchange Algorithms, I think the simplest way is with this method. We could create a script that repeats the method multiple times (8 for most efficient, but secure) and then convert the integers returned into letters.

I think the next step is creating a symmetric algorithm that can't be easily broken, but can still be used for a secure Mesh. Something people would be willing to transfer useful, but not important passwords over. Like a user account to a desktop computer that is only accessible by family and close friends.

Obviously a shift-cipher wouldn't be secure enough. So what ideas do you guys have?

Make sure to keep it to simple math algorithms like: Plain Text > letter'i * key'i > Cipher Text. i symbolizes which letter. So something like Letter 1 (or letter 'i') of "secret message".

I've Made a ton of encrypt dlls in VB.NET, so you could use one of those if you want.
Contact me at [removed]

I'm afraid we need a purely Scratch based encryption algorithm, but thanks anyways.

Offline

 

#17 2012-04-24 21:55:35

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Scratch Cryptography

bobbybee wrote:

Magnie wrote:

bobbybee wrote:


Plus not everyone has the knowledge to do so.

Or the ability. I know some people block downloading and stuff. But of course everything here is probably only going to be in Scratch, so squeak stuff other than Mesh probably.

Let's get back on topic, shall we?

O.K... I made a simple substitution cypher.  It's not much, but it's here: http://scratch.mit.edu/projects/GeonoTRON2000/2493091


http://i.imgur.com/BAEgGDL.png

Offline

 

#18 2012-04-25 13:58:27

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

GeonoTRON2000 wrote:

bobbybee wrote:

Magnie wrote:


Or the ability. I know some people block downloading and stuff. But of course everything here is probably only going to be in Scratch, so squeak stuff other than Mesh probably.

Let's get back on topic, shall we?

O.K... I made a simple substitution cypher.  It's not much, but it's here: http://scratch.mit.edu/projects/GeonoTRON2000/2493091

Cool! Could you implement the encryption and decryption into a single project and upload that please?  smile

Offline

 

#19 2012-04-25 17:41:51

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Scratch Cryptography

Magnie wrote:

GeonoTRON2000 wrote:

bobbybee wrote:


Let's get back on topic, shall we?

O.K... I made a simple substitution cypher.  It's not much, but it's here: http://scratch.mit.edu/projects/GeonoTRON2000/2493091

Cool! Could you implement the encryption and decryption into a single project and upload that please?  smile

Sure!
Here you go:
http://scratch.mit.edu/projects/GeonoTRON2000/2495455


http://i.imgur.com/BAEgGDL.png

Offline

 

#20 2012-04-25 17:49:47

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

GeonoTRON2000 wrote:

Magnie wrote:

GeonoTRON2000 wrote:


O.K... I made a simple substitution cypher.  It's not much, but it's here: http://scratch.mit.edu/projects/GeonoTRON2000/2493091

Cool! Could you implement the encryption and decryption into a single project and upload that please?  smile

Sure!
Here you go:
http://scratch.mit.edu/projects/GeonoTRON2000/2495455

Thank you!

Offline

 

#21 2012-04-25 17:50:18

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch Cryptography

The problem in that project is that it's missing a key.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#22 2012-04-25 17:52:08

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch Cryptography

bobbybee wrote:

The problem in that project is that it's missing a key.

It's inside the project. The project notes say to change the number inside the project.

Offline

 

#23 2012-04-25 17:56:38

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch Cryptography

Yes, but it's impossible to safely transmit the toalpha variable. It just wouldn't work.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#24 2012-04-25 18:34:14

itsmomito
Scratcher
Registered: 2008-03-28
Posts: 100+

Re: Scratch Cryptography

Hey guys, I don't know much about encryption, but I would like to try making one. Could I join in? I will upload it as soon as i'm finished

Offline

 

#25 2012-04-25 18:41:38

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: Scratch Cryptography

Today in study hall I was bored (not the first time  tongue ), and I decided to make a hash function that could be worked out on paper. I made a big table of letter to binary codes, and then concocted a hash function that works on the following principle:
Assuming the input is abcd:

Code:

a ^ b
a ^ c
a ^ d
b ^ c
b ^ d
c ^ d

where ^ means the logical XOR action.
With the letter to binary chart, it takes only a couple minutes to compute the hash for a string of 4 characters, but it gets larger quickly.

Example wrote:

'jack' produces '110901021008'

Currently trying to make this in scratch.

Last edited by ohaiderstudios (2012-04-25 18:55:28)


Fork Clamor on GitHub!

Offline

 

Board footer