siteIcon

Tech Novice Tools

JavaScript Apps

burgerIcon

Shyftgear

A Reversible Encryption Scheme

Instructions

Don't tell anybody, but this app is a generalization of the Alien Language App that was coded in PHP.

That concept was our kick-off app for the 2019-20 school year, and was coded in Shyft_Python3 and Shyft_Java. Follow the respective links to see the source code.

Of course now, we are coding it in JavaScript, so now you will be able to compare all three languages to understand the nuances of programming in each. Remember, you can always see the source code for JavaScript apps!

This encryption scheme, this algorithm, is reversible, unlike some of our other obfuscation string manipulation apps.

Here's how it works:

  1. Obtain an integer (whole number, the 'shift') and a 'story' from the user
  2. Iterate through the story and identify alphabet symbols. Others will be untouched.
  3. Alphabet letters are categorized as vowel (aeiou) or consonant (bcdfghjklmnpqrstvwxyz).
  4. Whether vowel or consonant: each original letter is 'shifted' to the next letter that is 'shift' units to the right of the original. Using the magic of the 'modulus operator' (%), a 'wrap-around' feature protects against situations where the end of the vowel or consonant string is reached.
  5. For example: 'encryption' ⇛ 'urgvcsxaer' with a shift of 3
  6. Try these shifts for interesting results: 0, 5, 21 and 105
  7. 'Casing' is preserved during the encryption process
  8. The encryption is reversed by applying the opposite of the shift to the encryption. Here's where using a function is so handy!

The goof-ball default quote? It's from a song...listen to it here.

Last update: 09/28/19


What's your story?