Press green flag again to generate/import/export a key. The principle is: Key is generated as a 2D array, 73x73. (As 73 characters are supported) The key is just all the supported characters in randomly generated order; each row contains each character once. To encrypt a character, a random row from the key is selected. The position of the character (likeable to its ASCII number) corresponds to the column in the key, this gives a new character. The encrypted text includes this new character, and another character corresponding to the row in the key that character is. Process repeats to build up the encrypted message. To decrypt the text, this process is reversed, to give the original characters. The key that was used to encrypt the text must be the same one used to decrypt the text, otherwise you get gibberish.
This is a remake of my original project. I wanted the encrypted text to use characters instead of numbers and splitters, as it looks better. However, I haven't yet implemented the case of characters, and so fewer characters are supported in this version. I've put the import/export function within the project, as the one Scratch uses sees the commas in the list then thinks it's a csv, so doesn't work here. Try to decrypt a message without the key you used to encrypt, it would be tricky. A weakness of this project is that if very small parts of the key are incorrect, the message is not completely altered, it may just look a little off. This could be exploited, by slowly building up a key from scratch and seeing if a decrypted message resembles an authentic sentence, getting closer to the real key and message each time. That could still take a while though, and is more of a problem with longer messages. Feel free to implement this anywhere, by no ultra-safe means of course, and if anyone does want to have a go at breaking this, go ahead! You can tell this is better than a simple cipher though, as it's extremely unlikely (almost 0 chance) that a message will ever encrypt to the same thing twice.