Best way to encode Wordle words? rot13 is too revealing
What's the best simple way to encode Wordle's 5-letter solutions? Go-to would normally be rot13, but that reveals a lot about the word - e.g. if it has any repeated letters.
This is actually a really good problem. How to keep secrets in javascript from browser clients? Most simply don't bother and store every thing server side. But for games like wordle, if you wanted it to be pro level multiplayer competitive, you'd need some punk-busting tech in there ;)
Base 64 encoding is good enough to hide a keyword from a casual glance
For simple sharing without giving it away, what about a RotN where N starts at an arbitrary value (13, for example) but increments for each successive character?
ALPHA
becomes
NZEXR
This way, repeats become opaque. Seems clear enough to share in the clear where _breaking_ the cipher isn't a big concern, just immediately recognizing the answer or patterns in it, is.
Choose an arbitrary length plaintext (8-10 characters would suffice), encode it with the given word as the key.
Do you need the whole solution or just a way to validate answers against them? The first n characters of a hash would work for the latter. For the former I'd encode it into something like base-122[0] or something else equally esoteric.
[0]http://blog.kevinalbs.com/base122
Maybe you could implement a provably-fair system similar to bitZino?
It just uses SHA256, you share the hash and at any later time prove fairness by letting the user rehash the secret themselves to compare against the original.
Provably Fair Shuffling Through Cryptography
https://archive.is/qwImN
Wouldn't you want to not give the client any information about the correct answer? I would think you would want to have a `POST` command that gives you the encoding guesses if you truly want to keep it out of the browser.
You could probably just split the word up with random gibberish letters in between. Easy enough to write and takes time to figure it out if there's any pattern.