ONE Challenge: Text encryption and decryption
You can visit the site by following the URL: text encryption and decryption.
This is a challenge proposed by the tutors of the ONE program (Oracle Next Education).
Although its name indicates a text cipher, it is actually a basic encoder. Whose objective is, excuse the redundancy, to encode a text.
The encoding consists of 5 rules, one for each vowel, which are the ones to encode:
const rules = {
a: ai,
e: enter,
i: imes,
o: ober,
u: ufat,
}
// Encrypt
const input = "gato"; //Output: "gaitober"
// Decrypt
const input = "gaitober" // Output: "gato"
- It should work with lowercase letters only, no accents or special characters.
- A word encoded several times can be decoded to its original version.
Pull requests are welcome 😉.