10-key Encoding
I recently made a big switch, and downgraded from my Samsung Galaxy smartphone to a dumb flip phone. I’ll spare you my soapbox speech about why, but one of the most jarring changes has been moving from a swipe-style keyboard to the classic 10-key keyboard. I was able to get used to it kinda quickly, having dealt with it many years ago, but I still stumble sometimes.
To help me get used to it, I created a new encoding method based on this archaic means of communication.
Demo
Explanation
The algorithm for this encoding method is as follows:
- Strip the input of non-alphanumeric characters, and split into individual characters.
- For each character, find its key and the number of taps needed to get to it via a dictionary.
- e.g.
Q
is equal to the 7 key and 7 taps (p, q, r, s, 7, P, Q
)
- e.g.
- Use the
key
value as the most significant 4-bits in a byte.- e.g. the 7 key ==
01110000
- e.g. the 7 key ==
- Use the
taps
value as the least significant 4-bits in a byte.- e.g. the 7 taps of the 7 key ==
01110111
- e.g. the 7 taps of the 7 key ==
- Add this byte to the output.
- Output the final string base64 encoded.
My Thoughts
I had originally planned on this being a cipher, but as I developed it, I slowly realized that instead I had just come up with an encoding method instead. No matter! This was still a fun project. It of course should be said that there’s lots of 10-key keyboards out there, and some of them have slightly different schemes. The one I used here is what’s available to me on the TCL T408DL flip phone.
Unlike when I attempt to make ciphers, there’s virtually no security here. Only “security by obscurity” is present here, which we all know is a losing game. But of course, it’s not really meant to be secure. It’s novel way of storing a texting pattern, and that’s all I set out to do.