ivankahl's solution to "Jumble / substitution algo - javascript - $200"

Hi,<\/p>\n\n

I have created a solution that should solve your issue. I have followed everything you requested in the diagram. The logic is contained in a single JS file called Jumbler.js inside the Jumbler class. You can simply include this file in any webpage where you want to use the logic. I have created a demonstration page here: https://repl.it/@ivankahl/JumbleSubstitution<\/a> .<\/p>\n\n

There are three methods that you can use:<\/p>\n\n

Hi, I have created a solution that should solve your issue. I have followed everything you requested in the diagram. The logic is contained in a single JS file called Jumbler.js inside the Jumbler class. You can simply include this file in any webpage where you want to use the logic. I have created a demonstration page here: https://repl.it/@ivankahl/JumbleSubstitution . There are three methods that you can use: - `encrypt(text)` - Can be used to encrypt plain text. Returns an object containing the encrypted text (result) as well as the key (key) - `verify(jumbledText, key)` - Can be used to verify that the specified jumbled text and key are valid. - `decrypt(jumbledText, key)` - Can be used to decrypt the encrypted text with the specified key. The key and encrypted text needs to be valid! See the _script.js_ file for how the class can be used. The encryption process is as follows: 1. Use a seeded random generator to generate a random integer which will be used to perform a caesar cipher (it will be shifted by n characters where n is the randomly generated integer) 2. Use another seeded random generator (different seed from the first) to generate a ciphertext alphabet. Use this alphabet to then shuffle the rotated text from Step 1 3. Generate the key which is in the following format (each component is divided by an alphabet character which can be determined by the first integer in the key): `"[INDEX_OF_SEPERATOR_CHARACTER][SEPARATOR][INT VALUES TO SEED CAESAR CIPHER][SEPARATOR][INT VALUES TO SEED MIXED ALPHABET CIPHER][SHA256 OF ENCRYPTED TEXT]"` 4. The SHA256 for the key is calculated and then also appended to the end of the message. This allows for us to verify that both the message and key are unchanged: `"[ENCRYPTED MESSAGE][SHA256 OF KEY]"` The verify process simply checks to make sure that the SHA256 in the key and encrypted text match. If either value is modified the check will fail. The decryption process is simple the reverse of the encryption process. Please let me know if you have any queries or improvements you'd like made.
Hi, I have created a solution that should solve your issue. I have followed everything you requested in the diagram. The logic is contained in a single JS file called Jumbler.js inside the Jumbler class. You can simply include this file in any webpage where you want to use the logic. I have created a demonstration page here: https://repl.it/@ivankahl/JumbleSubstitution . There are three methods that you can use: - `encrypt(text)` - Can be used to encrypt plain text. Returns an object containing the encrypted text (result) as well as the key (key) - `verify(jumbledText, key)` - Can be used to verify that the specified jumbled text and key are valid. - `decrypt(jumbledText, key)` - Can be used to decrypt the encrypted text with the specified key. The key and encrypted text needs to be valid! See the _script.js_ file for how the class can be used. The encryption process is as follows: 1. Use a seeded random generator to generate a random integer which will be used to perform a caesar cipher (it will be shifted by n characters where n is the randomly generated integer) 2. Use another seeded random generator (different seed from the first) to generate a ciphertext alphabet. Use this alphabet to then shuffle the rotated text from Step 1 3. Generate the key which is in the following format (each component is divided by an alphabet character which can be determined by the first integer in the key): `"[INDEX_OF_SEPERATOR_CHARACTER][SEPARATOR][INT VALUES TO SEED CAESAR CIPHER][SEPARATOR][INT VALUES TO SEED MIXED ALPHABET CIPHER][SHA256 OF ENCRYPTED TEXT]"` 4. The SHA256 for the key is calculated and then also appended to the end of the message. This allows for us to verify that both the message and key are unchanged: `"[ENCRYPTED MESSAGE][SHA256 OF KEY]"` The verify process simply checks to make sure that the SHA256 in the key and encrypted text match. If either value is modified the check will fail. The decryption process is simplesimply the reverse of the encryption process. Please let me know if you have any queries or improvements you'd like made.
Hi, I have created a solution that should solve your issue. I have followed everything you requested in the diagram. The logic is contained in a single JS file called Jumbler.js inside the Jumbler class. You can simply include this file in any webpage where you want to use the logic. I have created a demonstration page here: https://repl.it/@ivankahl/JumbleSubstitution . There are three methods that you can use: - `encrypt(text)` - Can be used to encrypt plain text (including tabs, spaces, new lines and carriage returns). Returns an object containing the encrypted text (result) as well as the key (key) - `verify(jumbledText, key)` - Can be used to verify that the specified jumbled text and key are valid. - `decrypt(jumbledText, key)` - Can be used to decrypt the encrypted text with the specified key. Returns an object containing the encrypted text (result) as well as the key (key) - `verify(jumbledText, key)` - Can be used to verify that the specified jumbled text and key are valid. - `decrypt(jumbledText, key)` - Can be used to decrypt the encrypted text with the specified key. The key and encrypted text needs to be valid! See the _script.js_ file for how the class can be used. The encryption process is as follows: 1. Use a seeded random generator to generate a random integer which will be used to perform a caesar cipher (it will be shifted by n characters where n is the randomly generated integer) 2. Use another seeded random generator (different seed from the first) to generate a ciphertext alphabet. Use this alphabet to then shuffle the rotated text from Step 1 3. Generate the key which is in the following format (each component is divided by an alphabet character which can be determined by the first integer in the key): `"[INDEX_OF_SEPERATOR_CHARACTER][SEPARATOR][INT VALUES TO SEED CAESAR CIPHER][SEPARATOR][INT VALUES TO SEED MIXED ALPHABET CIPHER][SHA256 OF ENCRYPTED TEXT]"` 4. The SHA256 for the key is calculated and then also appended to the end of the message. This allows for us to verify that both the message and key are unchanged: `"[ENCRYPTED MESSAGE][SHA256 OF KEY]"` The verify process simply checks to make sure that the SHA256 in the key and encrypted text match. If either value is modified the check will fail. The decryption process is simply the reverse of the encryption process. Please let me know if you have any queries or improvements you'd like made.
Hi, I have created a solution that should solve your issue. I believe I have followedimplemented everything you requested in the diagram. The logic is contained in a single JS file called Jumbler.js inside the Jumbler class. You can simply include this file in any webpage where you want to use the logic. I have created a demonstration page here: https://repl.it/@ivankahl/JumbleSubstitution . There are three methods that you can use: - `encrypt(text)` - Can be used to encrypt plain text (including tabs, spaces, new lines and carriage returns). Returns an object containing the encrypted text (result) as well as the key (key) - `verify(jumbledText, key)` - Can be used to verify that the specified jumbled text and key are valid. - `decrypt(jumbledText, key)` - Can be used to decrypt the encrypted text with the specified key. The key and encrypted text needs to be valid! See the _script.js_ file for how the class can be used. The encryption process is as follows: 1. Use a seeded random generator to generate a random integer which will be used to perform a caesar cipher (it will be shifted by n characters where n is the randomly generated integer) 2. Use another seeded random generator (different seed from the first) to generate a ciphertext alphabet. Use this alphabet to then shuffle the rotated text from Step 1 3. Generate the key which is in the following format (each component is divided by an alphabet character which can be determined by the first integer in the key): `"[INDEX_OF_SEPERATOR_CHARACTER][SEPARATOR][INT VALUES TO SEED CAESAR CIPHER][SEPARATOR][INT VALUES TO SEED MIXED ALPHABET CIPHER][SHA256 OF ENCRYPTED TEXT]"` 4. The SHA256 for the key is calculated and then also appended to the end of the message. This allows for us to verify that both the message and key are unchanged: `"[ENCRYPTED MESSAGE][SHA256 OF KEY]"` The verify process simply checks to make sure that the SHA256 in the key and encrypted text match. If either value is modified the check will fail. The decryption process is simply the reverse of the encryption process. Please let me know if you have any queries or improvements you'd like made.
Hi, I have created a solution that should solve your issue. I believe I have implemented everything you requested in the diagram. The logic is contained in a single JS file called Jumbler.js inside the Jumbler class. You can simply include this file in any webpage where you want to use the logic. I have created a demonstration page here: https://repl.it/@ivankahl/JumbleSubstitution . There are three methods that you can use: - `encrypt(text, includeVerificationHashes)` - Can be used to encrypt plain text (including tabs, spaces, new lines and carriage returns). Returns an object containing the encrypted text (result) as well as the key (key). You can also optionally specify if the SHA256 hashes should be included (false by default) - `verify(jumbledText, key)` - Can be used to verify that the specified jumbled text and key are valid. - `decrypt(jumbledText, key)` - Can be used to decrypt the encrypted text with the specified key. The key and encrypted text needs to be valid! See the _script.js_ file for how the class can be used. The encryption process is as follows: 1. Use a seeded random generator to generate a random integer which will be used to perform a caesar cipher (it will be shifted by n characters where n is the randomly generated integer) 2. Use another seeded random generator (different seed from the first) to generate a ciphertext alphabet. Use this alphabet to then shuffle the rotated text from Step 1 3. Generate the key which is in the following format (each component is divided by an alphabet character which can be determined by the first integer in the key): `"[INDEX_OF_SEPERATOR_CHARACTER][SEPARATOR][INT VALUES TO SEED CAESAR CIPHER][SEPARATOR][INT VALUES TO SEED MIXED ALPHABET CIPHER][SHA256 OF ENCRYPTED TEXT]"` 4. The SHA256 for the key is calculated and then also appended to the end of the message. This allows for us to verify that both the message and key are unchanged: `"[ENCRYPTED MESSAGE][SHA256 OF KEY]"` The verify process simply checks to make sure that the SHA256 in the key and encrypted text match. If either value is modified the check will fail. The decryption process is simply the reverse of the encryption process. Please let me know if you have any queries or improvements you'd like made.

User: ivankahl

Question: Jumble / substitution algo - javascript - $200

Back to question