Top Banner
Cubic cipher
25

Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Dec 18, 2015

Download

Documents

Jocelyn Cain
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Cubic cipher

Page 2: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

key generation

First, form a Keystring like Playfair

E.g. Keyword=COLUMBIA

Keystring=COLUMBIADEFGHJKNPQRSTVWXYZ

Page 3: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

key generation

• Then wrap keystring around a 3X3X3 cube, but leave center empty.

• 2D and 3D views:

z=0 z=1 z=2

COL EFG QRS

UMB H J TVW

IAD KNP XYZ

Page 4: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

encryption

• Basic idea: for a cleartext letter, ciphertext = pair of letters around it on a straight line

• E.g. FEG and VRY COL EFG QRS

UMB H J TVW

IAD KNP XYZ

• Since there’re multiple adjacent pairs, there’re multiple ways to encrypt.

Page 5: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Encryption

• Adjacent pairs can go beyond the cube and “wrap back” to it (or think of the cube as being surrounded by copies of itself)

• E.g. CLO is also a valid encryption

LCOL EFG QRS

UMB H J TVW

IAD KNP XYZ

Page 6: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

encryption

• Two other examples:

CIU CDM

Page 7: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

encryption

• A less intuitive example: CPV

COL EFG QRS

UMB H J TVW

IAD KNP XYZ

Page 8: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

encryption

• 13 such symmetric pairs (above/below, left/right, in front/behind, in front-above/behind-below, …)

• Mathematically… (x, y, z = coordinates of letter)1. x+1 and x-1

2. y+1 and y-1

3. z+1 and z-1

4. x+1, y-1 and x-1, y+1

5. x+1, y+1 and x-1, y-1

6. x+1, z-1 and x-1, z+1

7. x+1, z+1 and x-1, z-1

8. y+1, z-1 and y-1, z+1

9. y+1, z+1 and y-1, z-1

10. x+1, y+1, z+1 and x-1, y-1, z-1

11. x+1, y+1, z-1 and x-1, y-1, z+1

12. x+1, y-1, z+1 and x-1, y+1, z-1

13. x+1, y-1, z-1 and x-1, y+1, z+1

Page 9: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

encryption

• Each pair has two directions

• E.g. COL or LO

• So, total of 13X2 = 26 pairs

Page 10: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Encryption

• But 2 of them involve the empty space in the middle, so drop them.

• Overall, 24 possible encryptions for each letter.

Page 11: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

encryption

• Which of the 24 encryptions to pick?

• Use a distribution function to decide

• Right now, distribution function simply returns random integer from 0 to 24

All 24 encryptions have equal chance

• More on this later.

Page 12: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

decryption

• Basic idea: take the two ciphertext characters, find the letter that forms a straight line with them.

• Technical term? Zeph: “It’s called Cubic projection… or something like that.”

• Very simple, but not sure how to describe in English.

Page 13: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

decryption

• Use 2D as example. Only 2 possibilities

• Case 1: lie on the same x-coordinate

• That means cleartext lies on the same coordinate also

Page 14: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

decryption

• Case 2: lie on different x-coordinates

• That means cleartext lies on the third, unoccupied x-coordinate

Page 15: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

decryption

• For our case, basically repeat the above for all 3 planes (xy, xz, yz) of the cube

Page 16: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

nulls

• Nulls = meaningless characters in the ciphertext to confuse cryptanalyst

• In my cipher, you can produce nulls by encrypting the empty space in the middle

Page 17: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

nulls

• E.g. EP/PE and MV/VM are adjacent pairs of the empty space.

COL EFG QRS COL EFG QRS

UMB H J TVW UMB H J TVW

IAD KNP XYZ IAD KNP XYZ

• So, when decrypted, EP, PE, MV, and VM conveniently become the empty character and disappear: EP’ ‘

Page 18: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

nulls

• Some examples:

MVEPVMVMPEVMMVEP VMMVVMMVOLMVMVMVC

PEEPLOPEEPOLPEEPCC

• The cipher sprinkles nulls at random throughout the ciphertext

Page 19: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

nulls

• (Note: since the adjacent pairs of the empty space cannot contain the empty space itself, all adjacent pairs are valid. So there are 26 possible nulls, not just 24.)

• (Another note: because of nulls, ciphertext is in general more than twice as long as cleartext)

Page 20: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Sample encryptions

• Cleartext:“If one examines dialectic materialism, one is faced with a choice: either accept textual neocultural theory or conclude that narrative is created by the masses. Many narratives concerning the role of the observer as reader exist.” (From Postmodernism Generator)

• Ciphertext:

YUNENIQMBITVHESQKOJOHEXFHGFNNZPXZAWYXJQOTVRNQIHEUYTXGELWCXVPBIATRVTRMTXFCFBKNIUXEHOUPVZAQXDVBVNRYXIDNKYWIGTQRACIHMPZGNZDXFOWWYAQUOWGOSSHEHZYANUOBQSDOWYMDJTOEHMLARANMGPDLMQWWLUKWVPSGRKZAULBFBDIYVGYJRSLZIGXLMRWBICWTAHZZDWYVIHEUAXBXUIHGXJCMZCBPSHSWYQFWLPOPLSDMDPVHWIZQIFXMXUOZKAZEPRNGONFMFPYSHWKPVYQEIHZSHRXTSNFLTOKGBIDGBMGSOQXGEUCTJEHHZXUEQGOUTKYKOHSBEHOFNYJYMJMJTPZZRTAVPTJNOZSSBVECIYXUTWHUEDHWKEUSCCXIDAMHETVQLYNQXIBHWSUXRMGMDWLDALSYXGFPXWKBQSPUNQGVRKIIQ

Page 21: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Further development?

• As I mentioned, right now all 24 (26 for null) ciphers for each letter have equal probability.

• Dist.Func. just returns random int in [0, 25]

int distFunc(char X) {

return rand.nextInt(26);

}

Page 22: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Further development?

• But can make it more complicated by limiting the choices for some letters to less than 24

• E.g. frequency balancing for homophony

• Or the opposite: “unbalance” it (make the ciphertext for ‘Z’ the most frequency bigraph) to throw people off (Shane’s suggestion)

Page 23: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Further development?

• Encrypt the ciphertext again using the same key or some key derived from it?

• Instead of adjacent pairs, use weirder pairs (or perhaps determine what to use by looking at the keyword)

Page 24: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Weaknesses

• subject to bigraph frequency analysis, although nulls and 1-to-24 help a little

• too simple?

Page 25: Cubic cipher. key generation First, form a Keystring like Playfair E.g. Keyword=COLUMBIA Keystring=COLUMBIADEFGHJKNPQRSTV WXYZ.

Thanks!

All Hail the Fu