Sunday, September 28, 2008

Clever Cryptology

EDIT: Irrational84 is, of course, right. To encode Z it would have to be base 36. *headdesk* For the code at the bottom, stick with 35. It's ok, there are no Zs!


I have come up with an idea of cryptology that I think is fabulously clever: convert back and forth from base 35!


I can tell this will need some explaining.


First let us discuss what different bases mean. (Does this need to be explained? I worry about this. I want to keep everything clear and clean, explaining as few things as possible, I also want my writing to be accessible to the layperson. (What a weird construct. Oh, the lengths I go through for gender neutrality.) In my experience what it means to be in a different base is somewhat erudite, (So is the word erudite. God damn it, you can look up your own words!) so I will explain it.)

 

Normally we count in base ten, this is what we have been conditioned to think in and seems like the natural, nay, the only way to count. What this means is that we can phrase our counting like so:

 

10^0

10^1

10^2

10^3

10^4

1

10

100

1000

10000

ones

tens

hundreds

thousands

ten-thousands

 

As you can see saying that we count in base ten means that our most basic way of dividing numbers is based on the powers of ten. So counting in binary would look something like this:

 

2^0

2^1

2^2

2^3

2^4

1

10

100

1000

10000

ones

twos

fours

eights

sixteens

 

This chart makes a bit less sense. But say you wanted to write three in binary. Three is 2^1 (2) +2^0 (1) or 10 + 1, thus three is 11. So what’s twenty in binary? It’s 2^4 (16) + 2^2 (4) or 10000 + 100, thus twenty is 10100. See, isn’t that simple? And using the above mentioned chart one can easily transfer into any base, including those larger then ten. Let’s take a look at hexadecimal, as an example.

 

16^0

16^1

16^2

16^3

16^4

1

10

100

1000

10000       

ones

sixteens

256’s

4096’s

6153’s

 

So let’s say we wanted twelve, that’s just C. WHAT? A letter? That’s because once the bases get above ten we can’t keep using normal numbers because the numbers have two symbols in them. So new symbols need to be chosen, and the convention is to just use letters. Therefore ten in hexadecimal is A, eleven B, twelve C, thirteen D and so on until fifteen which is F. Sixteen, as can be seen above, is 10. So, what’s 300? Well, 300 = 16^2 (256) + (16^1)*2 (32) + (16^0)*C (13) or 12C. Understand? Let’s try a harder one. What’s 5,000,000,000 in hexadecimal? (What? Just use a calculator!) OK! Let’s go!

 

5,000,000,000 = 16^8 (4,294,967,296) + (16^7)*2 (536,870,912) + (16^6)*A (167772160) + (16^4)*5 (327,680) + (16^3)*F (61440) + (16^2)*2 (512)

 

Therefore 5,000,000,000 in hexadecimal is 12A05F20. (I may have made a mistake in my work, but the process is correct!) Isn’t that cool? It was fun too! I like changing bases! (Have I mentioned lately that I am a nerd?)

 

OK! Back to my wondrous code of wonderment! Now, don’t you see that any phrase can be transferred into base 35? It would create horrendously long numbers, but by using a reasonably simple, consistent, easy to memorize rule these numbers can be transformed back into words! As long as the phrases are written in the Latin alphabet a message of any length and complexity can be coded, and the code is non-intuitive, thus much harder to crack! The big problem is that longer words create numbers that are so long they become difficult to manipulate, even with calculators. (Someone should (someone probably already has) write a program to do this. (I suppose I could. (Hmm…)))

 

I think it’s clever.

 

To test you all I’ll put a normal blog post (You know, instead of writing about ideas I’ll write about my life!) in code! To read about the mundanities of my life you’ll have to crack the code!

 

18 44,269,875 18 27,334 400 653 930,874. 1,393,204 479 18 479?

 

(If you try and translate that and it makes no sense, please tell me! I’m worried I’ve made a mistake.)

1 comment:

Anonymous said...

I've given this a lot of thought, and I realized that base 35 only goes up to the letter Y (see http://en.wikipedia.org/wiki/Base_36 for the base 10/base 36 chart). But the message in this post still works because it doesn't contain the letter Z. ;)