Wednesday, March 18, 2009

Cyphers are Fun!

I recently posed a riddle to some forum people on one of the forums I frequent.
I made it easy and didn't use any Encryption Keys or initialization vectors.
The basic idea is as follows

Draw a square 11 boxes to a side, now block out the top left square, it won't be used.
Next fill in the top row and left column with the numbers 1-0


1

2

3

4

5

6

7

8

9

0

1











2











3











4











5











6











7











8











9











0











Next you would fill in the blocks using your encryption key, the key can be as long as you want it, the only real rules are to not repeat any letter more than 4 times and I and J are for our purposes the same letter, I didn't use an Encryption key to make it easier to decode, but I'll use "Verum Est a Tellum" here in this example.


1

2

3

4

5

6

7

8

9

0

1

V

E

R

U

M

E

S

T

A

T

2

E

L

L

U

M






3











4











5











6











7











8











9











0












So now that we have our Key in place we fill in the rest of the blanks using the alphabet remembering to make sure that each letter only shows up 4 times in the table.


1

2

3

4

5

6

7

8

9

0

1

V

E

R

U

M

E

S

T

A

T

2

E

L

L

U

M

B

C

D

F

G

3

H

I/J

K

N

O

P

Q

W

X

Y

4

Z

A

B

C

D

F

G

H

I/J

K

5

N

O

P

Q

R

S

V

W

X

Y

6

Z

A

B

C

D

F

G

H

I/J

K

7

L

M

N

O

P

Q

R

S

T

U

8

V

W

X

Y

Z

A

B

C

D

E

9

F

G

H

I/J

K

L

M

N

O

P

0

Q

R

S

T

U

V

W

X

Y

Z


I know it looks a bit confusing but all I do is count how many of each letter I have and then skip that letter for that many repetions of the alphabet.

V=1 E=3 R=1U=2 M=2 S=1 T=2 L=2

So the first repetion I skip all the letters of the key, the second only the letters with 2 or more, the third only those with 3 or more, and forth would be any letters that are repeated 4 times.


Next we take our plain text and convert it to the cipher.

For this example we will use "Cyphers are fun" as our plain text.

First letter is "C" so we find the letter "c" in the table and look to see which numeric characters coincide with "c"


1

2

3

4

5

6

7

8

9

0

1

V

E

R

U

M

E

S

T

A

T

2

E

L

L

U

M

B

C

D

F

G

3

H

I/J

K

N

O

P

Q

W

X

Y

4

Z

A

B

C

D

F

G

H

I/J

K

5

N

O

P

Q

R

S

V

W

X

Y

6

Z

A

B

C

D

F

G

H

I/J

K

7

L

M

N

O

P

Q

R

S

T

U

8

V

W

X

Y

Z

A

B

C

D

E

9

F

G

H

I/J

K

L

M

N

O

P

0

Q

R

S

T

U

V

W

X

Y

Z

In this example the numbers 2 and 7 coincide with the first "c" and we always use the number from the left column before we use the number for the top row, so our first number pair is 27. Other letter "c" number pairs are 44, 64, and 88.

Our next letter is y; its number pairs are 30, 50, 84, and 09. We continue assigning one number pair to each plaintext character until the entire message is encrypted.

27 30 36 48 80 02 03 = Cyphers

19 55 80 = Are

91 05 34 =Fun.

Next to defeat people figuring word groups from length of words we remove the spaces and break the number pairs into even sized groups.

27303648 80020319 55809105 34

The advantage to using this key is that even if they decide to do a frequency check it will not give a correct frequency because each letter can be one of 4 different code groups, thats 100 different number pairs for 25 letters.

No comments: