Welcome Guest [Log In] [Register]
Welcome to Crypto. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
A Matrix Plus Key cipher; A two-key cipher
Topic Started: Jan 4 2014, 08:33 PM (318 Views)
fiziwig
Elite member
[ *  *  *  *  * ]
This probably is not original, but I just came up with the idea and I don't recall seeing it before. Please let me know if this is has been done before.

Begin with a 6 X 6 matrix of A-Z,0-9. In this example the matrix will be unmixed for illustration purposes, but in practice it should be mixed in the usual key-based manner. The matrix is built with the first key.

The matrix:

Code:
 
A[space]B[space]C[space]D[space]E[space]F
G[space]H[space]I[space]J[space]K[space]L
M[space]N[space]O[space]P[space]Q[space]R
S[space]T[space]U[space]V[space]W[space]X
Y[space]Z[space]0[space]1[space]2[space]3
4[space]5[space]6[space]7[space]8[space]9


The second key is a keyphrase used to determine how each letter is enciphered. For example: "SECRET AGENT 007"

The Key phrase is repeated over the top of the message to be enciphered, extending the key one character beyond the end of the message:

message: BRING THE JEWELS TO 459 DURELLA STREET

Code:
 
SECRETAGENT007SECRETAGENT007SECRE
BRINGTHEJEWELSTO459DURELLASTREET


To determine the encipherment of the first letter take the first two letters of the key and note the move (x,y) that take you from the first letter to the second. For example:

S->E is a move 4 to the right and three up. (4,-3). Notice that this is the same as two to the left and 3 up (-2,-3). Use whichever version is easiest for you. Now that we have the move (4,-3), apply that same move to the first plaintext letter. B moving (4,-3) brings us to X. So we write the first letter:

Code:
 

S->E[space]is[space](4,-3)[space]so[space]B->X

SECRETAGENT007SECRETAGENT007SECRE
BRINGTHEJEWELSTO459DURELLASTREET
X

Using[space]the[space]second[space]and[space]third[space]key[space]letters:

E->C[space]is[space](-2,0)[space]so[space]R->P

SECRETAGENT007SECRETAGENT007SECRE
BRINGTHEJEWELSTO459DURELLASTREET
XP

C->R[space]is[space](3,2)[space]so[space]I->X

SECRETAGENT007SECRETAGENT007SECRE
BRINGTHEJEWELSTO459DURELLASTREET
XPX

R->E[space]is[space](-2,-1)[space]so[space]N->L

SECRETAGENT007SECRETAGENT007SECRE
BRINGTHEJEWELSTO459DURELLASTREET
XPXL

And[space]so[space]on[space]with[space]the[space]whole[space]message:

SECRETAGENT007SECRETAGENT007SECRE
BRINGTHEJEWELSTO459DURELLASTREET
XPXA1AN6SK3EMJFMJSOU0JNRMAZK7COG

Leaving[space]us[space]with[space]the[space]enciphered[space]message:

XPXA1[space]AN6SK[space]3EMJF[space]MJSOU[space]0JNRM[space]AZK7C[space]OG


To decipher repeat the process in reverse. Use the key to determine the next move and make that move in reverse to get from the ciphertext letter to the original plaintext letter.
Edited by fiziwig, Jan 4 2014, 08:35 PM.
Offline Profile Quote Post Goto Top
 
mok-kong shen
NSA worthy
[ *  *  *  *  *  * ]
An interesting scheme IMHO. I suppose that, instead of using a pair of characters in the key to specify the movement of a plaintext character to the ciphertext character, one could alternatively adopt the convention of using a single key character to specify the movement, e.g. in the given matrix U would give (3,4) as the movement. Presumably one could also render the matter more complicated for the opponent in that one employs two matrices and uses the key character to determine the movement from one matrix and uses the other matrix to move the plaintext character to the ciphertext character.
Edited by mok-kong shen, Jan 4 2014, 10:26 PM.
Offline Profile Quote Post Goto Top
 
fiziwig
Elite member
[ *  *  *  *  * ]
mok-kong shen
Jan 4 2014, 10:17 PM
An interesting scheme IMHO. I suppose that, instead of using a pair of characters in the key to specify the movement of a plaintext character to the ciphertext character, one could alternatively adopt the convention of using a single key character to specify the movement, e.g. in the given matrix U would give (3,4) as the movement. Presumably one could also render the matter more complicated for the opponent in that one employs two matrices and uses the key character to determine the movement from one matrix and uses the other matrix to move the plaintext character to the ciphertext character.
I like both of those ideas!

Using a single letter from the key any taking it's location in the matrix as the movement makes sense and would simplify the cipher. Then you could just have a list of movement distances instead of a matrix.

That would be the equivalent of have 26 (or 36) scrambled alphabets, one for each key letter (or number). Like a Vig, but more complex because each alphabet is scrambled.

So effectively, this is just a way of generating 26 (or 36) different alphabets from two keyed alphabets in two matrices.

Using the "QUICK BROWN FOX alphabet for the movement keys and the Moby Dick ("Call Me Ishmael") alphabet for the enciphering we could write down all the results ahead of time and have 36 different alphabets:

Code:
 
THEQUICKBROWNFXJMPSVLAZYDG0123456789

T[space]H[space]E[space]Q[space]U[space]I
C[space]K[space]B[space]R[space]O[space]W
N[space]F[space]X[space]J[space]M[space]P
S[space]V[space]L[space]A[space]Z[space]Y
D[space]G[space]0[space]1[space]2[space]3
4[space]5[space]6[space]7[space]8[space]9

0123456789CALMEISHOYRGNVDWPTUBFZQKXJ

0[space]1[space]2[space]3[space]4[space]5[space]
6[space]7[space]8[space]9[space]C[space]A[space]
L[space]M[space]E[space]I[space]S[space]H[space]
O[space]Y[space]R[space]G[space]N[space]V[space]
D[space]W[space]P[space]T[space]U[space]B[space]
F[space]Z[space]Q[space]K[space]X[space]J

And[space]get[space]these[space]36[space]alphabets:

PLAIN:[space][space]ABCD[space]EFGH[space]IJKL[space]MNOP[space]QRST[space]UVWX[space]YZ01[space]2345[space]6789
----------------------------------------------------
A[space](3,3)[space]P8W9[space]JI0Q[space]FELK[space]X13A[space]H5Z6[space]72CM[space]4SGN[space]VOYR[space]TUBD
B[space](2,1)[space]MZLQ[space]N2BY[space]V1R5[space]0DPX[space]4U...
C[space](0,1)[space]HJSF[space]R0TV[space]G53O[space]YF...
D[space](0,4)[space]JHXL[space]2O95[space]3V...
...
9[space](5,5)[space]4N3V[space]7BEC[space]8UPA[space]6IHY[space]WM9R[space]GSOT[space]LDJF[space]XQKX[space]J012


Edited by fiziwig, Jan 5 2014, 12:07 AM.
Offline Profile Quote Post Goto Top
 
Linokai
Member
[ *  * ]
You could also use a single matrix for this and use mok-kong shen's idea of using a single key character to determine the movement, then after each character is enciphered, the key character and the plaintext character swap places. If the key character and the plaintext character are the same character, swap it with the character in the (0,0) position, if they are the same character, and already in the (0,0) position, then swap it with the character in the (5,5) position. You could also swap the plaintext character with the ciphertext character. I'm not sure which would be better....
Offline Profile Quote Post Goto Top
 
Linokai
Member
[ *  * ]
Okay. I thought of another idea for this. You could use a 8*5 matrix with (A-Z), (1-0), & (.?*#).

Use the # to indicate spaces.

Use an interrupted running key:

i.e.,
if Plaintext = SECRET#MESSAGE.
& Pass = GUMPTION,
then Keystream = GUMPTION#SECRET#GUMPTION#MESSAGE.

After each character is encrypted:
1) The plaintext and ciphertext characters swap places (If they are the same character nothing happens).
2) The keystream character swaps places with the *
(If the plaintext character and keystream character are the same, it gets moved twice.)
Offline Profile Quote Post Goto Top
 
Linokai
Member
[ *  * ]
Okay, Last one i promise ;)

To add even more dynamics to this, Instead of determining the shift by the distance of the keystream character from a fixed position (i.e., the corner), the shift is determined by counting the spaces from the asterisk (*) to the keystream character. I think this would add a lot more dynamics to it, since the * is constantly moving to different places in the matrix.

It also creates an interesting exception, where everytime there's a * in the ciphertext, it gets moved twice.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · General · Next Topic »
Add Reply