LPM: Encryption Question

Joe Hourcle oneiros at dcr.net
Tue Dec 21 14:47:18 CST 1999

```
On Tue, 21 Dec 1999, Janine Ladick wrote:

> Does anyone know of a way to disguise a number so that it can be
> easily (as in, by eye) undisguised?  Here's the scenario:

What qualifies as 'by eye undisquised'?

If you're looking for something that people can do in their head, your
system works.  You can also do more obnoxious patterns, such as shifting
all odd numbers up 4, all even numbers down 4, so that:
0123456789
becomes
6587092143
(naturally, with anything passing 0/10 re-entering at the other side.)

You can also use the 'code wheel' approach, where you assign every number
any unique arbitrary number, which you can handle quite easily by keping
the 'code wheel', as some random array.
eg.
@values = ( 2,7,0,1,4,3,8,6,9,5 );
(you'll of course want to build either a hash or an array from that for
looking everything up for decoding, as there's no equivalent of
'member()' from C in Perl that I know of.)

If you need something that doesn't have to be so easy to decode in one's
head, you can also place the number into some other base, and manipulate
it.  So it's a short code, you can use base 35, using alpha-numeric, but
omitting O, so people don't have a problem with 0/O confusion, i.e:
(0..9,A..N,P..Z)
Depending on the font, you might also want to beware of G/6 and 1/I
confusion.

(You can also be lazy, and just use hexidecimal, if you wish)

-----
Joe Hourcle

```