* Scratch 3 has broken MD5 :( SHA256 still works * Given a string input, you will get its hash based on two very common hashing algorithms, MD5 and SHA-256. They are known as Cryptographic Hash Functions and can be used for authenticating, encoding and storing data. MD5, while no longer considered secure, can still be used for calculating checksums (comparing data). SHA-256, however, is still highly secure and is very commonly used to store passwords on the internet.
How to use this: 1. Move the hash sprite into your backpack 2. Click the When Green Flag Script to create all the relevant variables, then delete that script 3. Also delete the When I Recieve Hash script 4. To your own project, add When Green Flag Clicked; Initialise [the custom block] 5. When you want the user to verify a password (or whatever you want hashed), add Return = HashPassword(users_input); if Return = [prehashed_password]: # This is the correct password - allow access etc else: # This is the incorrect password - deny access etc (This is somewhat in pseudocode but hopefully its obvious what I mean) MD5 takes about 1 second. SHA-256 takes about 5 seconds. Input can contain any keyboard characters except £ € ¬ ¦ Non-latin characters such as ß é 汉 are also not allowed Outputs in hexadecimal. Input can be any length, since the hash functions are many-to-one. If you can find two inputs that give the same output, this is known as a collision but this is meant to happen very infrequently. MD5 has a known weakness which allows collisions to be created, which is the reason behind its insecurity. MD5 Scratch implementation by @Lax125 SHA-256 Scratch implementation by @scratching2x Both of these originally contained bugs! I fixed them here. Converted to presentable custom blocks by @Nick_2440 (me) Check MD5 here: https://passwordsgenerator.net/md5-hash-generator/ Check SHA-256 here: https://passwordsgenerator.net/sha256-hash-generator/ Keywords: md5 sha256 sha-256 string hash generator cryptography secure security password encryption checksum custom block algorithm authentication secure crypto bitcoin