Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
- PenguinLover1123
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
I need it for future projects, since hashes are a fixed length. And? Infinite cloud data! No more having to make
and a stretch-through-10-cloud-variables script!
Last edited by PenguinLover1123 (Sept. 26, 2021 14:38:57)
- u7p
-
100+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Hashes and Encryption are very different, hashes are a form of data masking and cannot be reversed or “un-hashed”. I'm reporting this to be moved to advanced topics.
- PenguinLover1123
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Then why is it used for password databases? Hashes and Encryption are very different, hashes are a form of data masking and cannot be reversed or “un-hashed”. I'm reporting this to be moved to advanced topics.
These kinds of encryptions, often called hashes, are widely used to securely store passwords in a database.
Last edited by PenguinLover1123 (Sept. 26, 2021 14:50:39)
- dhuls
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
So that an attacker doesn't get the original password.Then why is it used for password databases? Hashes and Encryption are very different, hashes are a form of data masking and cannot be reversed or “un-hashed”. I'm reporting this to be moved to advanced topics.These kinds of encryptions, often called hashes, are widely used to securely store passwords in a database.
- CST1229
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
To explain it further, when creating a password, a secure website doesn't store the original password. Instead, it stores a hash (often alongside a random value used in the hashing called salt) of the password. When the user needs to authenticate, the sent password is hashed on the server (after being combined with the salt) and checked against the existing hash. If it matches, the user gets access, otherwise the user is denied access.So that an attacker doesn't get the original password.Then why is it used for password databases? Hashes and Encryption are very different, hashes are a form of data masking and cannot be reversed or “un-hashed”. I'm reporting this to be moved to advanced topics.These kinds of encryptions, often called hashes, are widely used to securely store passwords in a database.
This way, a hacker can't get instant access to the account by getting access to the password hash database, since they would still need to find the string of characters that generates that particular hash.
Last edited by CST1229 (Sept. 26, 2021 15:35:34)
- Harakou
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
I agree that the AT folks often talk about hashing/encryption/etc, but this sounds like it would be an otherwise normal Scratch project? The line has always been a bit fuzzy there, but I'm not sure how they'd feel about what is essentially an advanced HWS question. I can move it for now, but may move it back later. Hashes and Encryption are very different, hashes are a form of data masking and cannot be reversed or “un-hashed”. I'm reporting this to be moved to advanced topics.
That said, I'm not sure what exactly you're trying to accomplish here. It's true that hashes are a fixed length, but they also represent a fixed amount of information as a result. They're not meant to be reversible, either. If you wanted to encode reversible information with them, you might as well create a lookup table. The end result would be pretty much the same thing.
- Chiroyce
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
2 best project demos for this
MD5 seems to be broken on the second project, btw.
SHA256 Hash Generator by @kenny2scratch
Shared on June 18 2021 | Last Updated on July 18 2021
________________________________________________________________________________________________
String Hash Generator (MD5 & SHA-256) by @Nick_2440
Shared on August 3 2018 | Last Updated on April 27 2021
MD5 seems to be broken on the second project, btw.
Last edited by Chiroyce (Sept. 27, 2021 12:11:22)
- Chiroyce
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Ummmmmm about that - I need it for future projects, since hashes are a fixed length. And? Infinite cloud data! No more having to make HASHES CANNOT be decoded, they can only be encoded, so no infinite cloud data!

- Chiroyce
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Then why is it used for password databases?https://youtu.be/b4b8ktEV4Bg
- PenguinLover1123
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Then hashes are useless. Correct? (NO RUDENESS)Ummmmmm about that - I need it for future projects, since hashes are a fixed length. And? Infinite cloud data! No more having to make HASHES CANNOT be decoded, they can only be encoded, so no infinite cloud data!
- PenguinLover1123
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
The first one is prefect! But we will need a decoder! 2 best project demos for thisSHA256 Hash Generator by @kenny2scratch (Note: PERFECT!)
Shared on June 18 2021 | Last Updated on July 18 2021
________________________________________________________________________________________________
String Hash Generator (MD5 & SHA-256) by @Nick_2440
Shared on August 3 2018 | Last Updated on April 27 2021
MD5 seems to be broken on the second project, btw.
- PenguinLover1123
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
A hash encoder/decoder, which means OO cloud dataI agree that the AT folks often talk about hashing/encryption/etc, but this sounds like it would be an otherwise normal Scratch project? The line has always been a bit fuzzy there, but I'm not sure how they'd feel about what is essentially an advanced HWS question. I can move it for now, but may move it back later. Hashes and Encryption are very different, hashes are a form of data masking and cannot be reversed or “un-hashed”. I'm reporting this to be moved to advanced topics.
That said, I'm not sure what exactly you're trying to accomplish here. It's true that hashes are a fixed length, but they also represent a fixed amount of information as a result. They're not meant to be reversible, either. If you wanted to encode reversible information with them, you might as well create a lookup table. The end result would be pretty much the same thing.
Note: OO = Infinity
- NFlex23
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
A hash encoder/decoder, which means OO cloud data
Note: OO = Infinity
Hashes CAN'T BE DECODED. The first one is prefect! But we will need a decoder!
Last edited by NFlex23 (Sept. 27, 2021 14:39:00)
- PenguinLover1123
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
But why?A hash encoder/decoder, which means OO cloud data
Note: OO = InfinityHashes CAN'T BE DECODED. The first one is prefect! But we will need a decoder!
- NFlex23
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Imagine you sha-256 hashed an entire movie, which is entirely possible. The encoded data would be only 64 characters! How on earth could you decode 64 characters to a full-length movie?But why?A hash encoder/decoder, which means OO cloud data
Note: OO = InfinityHashes CAN'T BE DECODED. The first one is prefect! But we will need a decoder!
Last edited by NFlex23 (Sept. 27, 2021 15:05:31)
- Chiroyce
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
1+2+3 = 6 But why?
Now if I give you ONLY the number 6, can you know what numbers I added to get 6?! Hashes are basically this, but instead of addition, it's complex math.
https://en.wikipedia.org/wiki/Hash_function
Last edited by Chiroyce (Sept. 27, 2021 15:26:16)
- Chiroyce
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Imagine you sha-256 hashed an entire movie, which is entirely possible. The encoded data would be only 64 characters! How on earth could you decode 64 characters to a full-length movie?
I ran a SHA256 hash on the Firefox executable for macOS and what I got was this -
c08ac0e6eda8c32c4dcce2ac0467a2a2d0220cfe4f4eebfa997d13547b89edf8

HOW on earth do you manage to compress a browser into 64 bytes? That's why it's impossible to decode hashes.
- imfh
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Another explanation for why hashes can't be decoded:
How many possible hashes are there with SHA256? Answer: 256 bits = 2^256 possible hashes
How many possible 100 character long text files are there? Answer: 100 characters = 800 bits = 2^800 possible files.
2^256 is less than 2^800. There more things which are possible to hash than there are hashes which you can possible have.
(2^3 is the same thing as three 2s multiplied together, 2*2*2 = 8, if you didn't know)
In short, a given hash can represent an infinite number of values. Modern hashes try to make hard to accidentally, or even purposely, find two things with the same hash, but those two things still exist. For example, with a really bad hash algorithm, “abcd” and “1234” might have the same hash of 507974686f6e20697320636f6f6c.
How many possible hashes are there with SHA256? Answer: 256 bits = 2^256 possible hashes
How many possible 100 character long text files are there? Answer: 100 characters = 800 bits = 2^800 possible files.
2^256 is less than 2^800. There more things which are possible to hash than there are hashes which you can possible have.
(2^3 is the same thing as three 2s multiplied together, 2*2*2 = 8, if you didn't know)
In short, a given hash can represent an infinite number of values. Modern hashes try to make hard to accidentally, or even purposely, find two things with the same hash, but those two things still exist. For example, with a really bad hash algorithm, “abcd” and “1234” might have the same hash of 507974686f6e20697320636f6f6c.
Last edited by imfh (Sept. 27, 2021 18:21:10)
- Chiroyce
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
Ah dang! I thought that would never happen with SHA256, is there any prize for finding a collision? Modern hashes try to make hard to accidentally find two things with the same hash, those two things still exist
- CST1229
-
1000+ posts
How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method
I thought modern hashes try to make it hard to Modern hashes try to make hard to accidentally find two things with the same hash, those two things still existpurposefully make two things with the same hash.
- Discussion Forums
- » Advanced Topics
-
» How to encode data into hashes (and decode the hashes) in Scratch? By hashes I mean the encryption method