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
Crypto Forum Collaborative Algorithim
Topic Started: Sep 1 2005, 05:40 AM (1,066 Views)
PulsarSL
Super member
[ *  *  *  * ]
Hello everyone,

I know it's a bit early, but I just want to get this idea out there. I think it'd be really sweet if we all put our heads together and made a good encryption algorithim.

I'm really interested in cryptography but there are some concepts I don't understand fully, but I've got other skills, mainly programming. I think that if we all worked together, we could develop a decent algorithim, and, in addition, the whole project would be a wonderful learning experience for anybody getting their feet wet.

Watcha think?

--PulsarSL
Offline Profile Quote Post Goto Top
 
insecure
Elite member
[ *  *  *  *  * ]
As long as we all understand it's just for laughs and learning. If you're hoping to earn a million from it, forget it. There's so much cool free stuff out there that's way better than anything we would be able to do ourselves. Twofish, Rijndael (AES), etc etc.

Offline Profile Quote Post Goto Top
 
Revelation
Member Avatar
Administrator
[ *  *  *  *  * ]
Of course we do it for fun, because we all like cryptography (I think) :)

Sounds like a cool idea, I am a programmer too :)
RRRREJMEEEEEPVKLWENFNVJKEEEEEAOLKAFKLXCFZAASDJXZTTTTTTTLSIOWJXMOKLAFJNNKFNXN
RAGRBAQEMHIGDJVDSEOXVIYCELFHWLELJFIENXLRATALSJFSLCYTKLASJDKMHGOVOKAJDNMNUITN
RRRRLJVEEEEECLYVYHNVPFTAEEEEEMWLMEIRNGLARWJAKJDFLWNTIERJMIPQWOTZEOCXKNUBNXCN
RJIRPOWEANFUSNCZVDVZNMSFEKLOEPZLDKDJWSAAAAAAAOERHJCTNCKFRIMVKSOFOMKMANREWNBN
RZUDRGXEEEEENFQIDVLQNCKNEEEEEDGLLLLLLAWIOSNCDARLODMTOEJXMILDFJROTKJSDNLVCZNN
Offline Profile Quote Post Goto Top
 
PulsarSL
Super member
[ *  *  *  * ]
insecure
Sep 9 2005, 05:38 PM
As long as we all understand it's just for laughs and learning. If you're hoping to earn a million from it, forget it. There's so much cool free stuff out there that's way better than anything we would be able to do ourselves. Twofish, Rijndael (AES), etc etc.

Definatly not for the money, I meant it as a learning experience... I don't know a whole lot about the actual algorithims behind the encryption, though I think it's cool and would like to know how they work.
Offline Profile Quote Post Goto Top
 
insecure
Elite member
[ *  *  *  *  * ]
What sort of cipher did you have in mind? Stream cipher? Block cipher?
Offline Profile Quote Post Goto Top
 
Donald
Elite member
[ *  *  *  *  * ]
How about a "good" pen and paper cipher?

Here is a somewhat elaborate system that I play with at times: (Cryptwolf suggested much of the system to me)

I'm putting the entire thing inside a code block so the spacing will work out right.
Code:
 
To make this system work you need 3 keywords.  keyword 1 and 3
should include numbers, keyword 2 can be alpha only.

For our example, lets pick
Keyword 1=rudolph13
Keyword 2=stinky
Keyword 3=elephant79


Use Keyword 1 to create a scrambled alphabet by removing any duplicate letters or numbers (none in this case) and writing the remaining alphabet, and digits 0-9 under the key.

RUDOLPH13
ABCEFGIJK
MNQSTVWXY
Z02456789

strip off by collums to obtain:
RAMZUBN0DCQ2OES4LFT5PGV6HIW71JX83KY9

put into 6*6 Square to obtain checkerboard. Label collumns and rows A-F


   A B C D E F  (key #1 checkerboard)
   -----------
A |r a m z u b
B |n 0 d c q 2
C |o e s 4 l f
D |t 5 p g v 6
E |h i w 7 1 j
F |x 8 3 k y 9

Do the same thing with keyword 3,

ELPHANT79   <-note we removed the duplicate e
BCDFGIJKM
OQRSUVWXY
Z01234568

EBOZLCQ0PDR1HFS2AGU3NIV4TJW57KX69MY8

   A B C D E F  (key #3 checkerboard)
   -----------
A |e b o z l c
B |q 0 p d r 1
C |h f s 2 a g  
D |u 3 n i v 4
E |t j w 5 7 k  
F |x 6 9 m y 8


To encrypt your message, we start with key #1 checkerboard.  Find each character from your message in the checkerboard and write down its row and collumn (in that order)

   A B C D E F  (key #1 checkerboard)
   -----------
A |r a m z u b
B |n 0 d c q 2
C |o e s 4 l f
D |t 5 p g v 6
E |h i w 7 1 j
F |x 8 3 k y 9

s  e  n  d  h  e  l  p  a  t  o  n  c  e   <-our secret message
CC BC AB CB AE BC EC CD BA AD AC AB DB BC  <-encrypted version

Now take keyword #2.  List your message under it horizontally.

4 5 1 3 2 6  <-alphabetical order of keyword #2
S T I N K Y  <-keyword #2
-----------
C C B C A B  <-our encrypted message from the previous step
C B A E B C
E C C D B A
A D A C A B
D B B C

Pull the message off by collumns, by alphabetical order of the keyword.  Repeat letters should count from left to right.  (so if you have two R's,the R to the left goes first, then the r to the right)

BACABABBACEDCCCCEADCBCDBBCAB  <-The new scrambled encrypted message!

Split this up into pairs and now use key #3 checkerboard to DECRYPT back from pairs into ordinary characters.

   A B C D E F   (key #3 checkerboard)
   -----------
A |e b o z l c
B |q 0 p d r 1
C |h f s 2 a g  
D |u 3 n i v 4
E |t j w 5 7 k  
F |x 6 9 m y 8

BA CA BA BB AC ED CC CC EA DC BC DB BC AB  <-from previous step
b  o  b  0  h  v  s  s  l  2  f  d  f  q   <-our new result

split result into 5 letter groups and there you go!
BOB0H VSSL2 FDFQ

To decrypt, reverse the entire process.

Use the key #3 checkerboard to translate into row/collumn letters

B  O  B  0  H  V  S  S  L  2  F  D  F  Q
ba ca ba bb ac ed cc cc ea dc bc db bc ab

Then count the total number of characters and divide by the number of letters in your second keyword.  From this you can figure out how many letters should be in each collumn, and how many collumns will be short one letter.  Put the character under the keyword in the order of the letters.

4 5 1 3 2 6
S T I N K Y
-----------
c c b c a b
c b a e b c
e c c d b a
a d a c a b
d b b c

yank back off by rows.  split into pairs and use the key #1 checkerboard to translate back into the original message!

cc bc ab cb ae bc ec cd ba ad ac ab db bc
s  e  n  d  h  e  l  p  a  t  o  n  c  e

send help at once!!!!!

Of course, I wouldn't expect this to hold out against the NSA if they really wanted to read it, but I certainly wouldn't want to try and crack this code.
On the negative side, with three encryption steps (not counting creating the checkerboards) it's slow and vulnerable to errors.



Offline Profile Quote Post Goto Top
 
insecure
Elite member
[ *  *  *  *  * ]
Here are your two keys, and my two (based on passwords insecure93 and crypto05, which I did not prepare especially):

Code:
 

RAMZUBN0DCQ2OES4LFT5PGV6HIW71JX83KY9
EBOZLCQ0PDR1HFS2AGU3NIV4TJW57KX69MY8
IAMZNBO0SDP1EFQ2CGT4UHV5RJW69KX73LY8
CAJV6RBKW7YDLX8PEMZ9TFN1OGQ20HS35IU4


As we can see, A appears in position 2 three times out of four (for these keys); M appears in position 3 twice; Z in pos 4 three times; B in position 5 twice; and so on.

This suggests that it might be possible massively to reduce the amount of work needed for a successful decrypt (compared to brute force). It's not an attack as such, but it could easily lead to one in the hands of someone with a little more determination than me!
Offline Profile Quote Post Goto Top
 
Donald
Elite member
[ *  *  *  *  * ]
Quote:
 
A appears in position 2 three times out of four (for these keys); M appears in position 3 twice; Z in pos 4 three times; B in position 5 twice; and so on

Darn good point. The "random" alphabets are not random enough, not by far.

First, solution, in general keys chosen need to be stronger then the examples I used. A dictionary attack would be EASY if all keys are a word plus a two digit number.

The maximum brute force search space of key#1 and key#3 is 36!=3.7E+0041, which is actually better than 128 bit AES (3.4E+0038). But, on a practical level, folks are VERY unlikely to choose key phrases long enough to actually use the entire alphabet and all 10 digits. BUT, we could at least suggest that the following rules for key phrases:
1: Keys should consists of at least two words joined by a number, more words is better.
2: At least one of the words in the key should be something that would NOT appear in a dictionary and is not a common name. (misspelled, first letters of a poem, etc) (This rule is of limited use since the very nature of these passphrases drops letters and is likely to drop the misspelled letters)

AND, we could change the way the scrambled alphabets are created. Instead of putting the alphabet under the key starting at A, we could start with the next letter (or digit) after the last letter (or digit) of the passphrase. So, for example, with the passphrase: breakfast34amfiog (A Mighty Fortress Is Our God)

breakfst34mig
hjlnopquvwxyz
cd01256789

bhcrjdel0an1ko2fp5sq6tu73v84w9mxiygz

That randomizes the alphabet a BIT better, but also really shows off the weakness of this system. Since repeat letters are dropped, the passphrase looses more and more characters as it get's longer. creating passphrases with a significant amount of entropy will be pretty difficult.


Offline Profile Quote Post Goto Top
 
insecure
Elite member
[ *  *  *  *  * ]
Is this one dead in the water, Donald? I was planning to implement it as a program (as befits a pencil-and-paper cipher!), but I won't do so if we don't plan to progress with it further.

If it's not dead, do you think the implementation should adopt your suggested change in the method of generating the key, or stick to the original method?
Offline Profile Quote Post Goto Top
 
Donald
Elite member
[ *  *  *  *  * ]
Quote:
 
Is this one dead in the water,

Not as far as I'm concerned. :)

Quote:
 
do you think the implementation should adopt your suggested change in the method of generating the key, or stick to the original method?


Needs to adopt the changed method. AND, I've been thinking on this. This isn't exactly a PRACTICAL cipher, so we might as well add one more small step that will increase the randomness of the checkerboards.

when creating the checkerboards:
Write down your keyword, eliminating any duplicate characters.
Write down the remaining alphabet underneath the keyword,
STARTING at the next character after the last character of the keyword.
Pull off by collumns, IN ALPHABETIC ORDER OF THE KEY.
note that numbers will sort before letters.

With those two rules we should get a VERY randomized alphabet. It's main weakness being that the first character will almost always be a numeric. I'm not certain how much of a weakness that is.

Of course, we can add all kinds of specifications for the key that will make the key stronger: (two words, numbers, and at least one of the words not in the dictionary), but those aren't properly part of the definition of the cipher, are they?

So, with those specifications, what do you think? What would be the primary method of attack against such a cipher? Is there any way to undo the last step better than brute force? (There has simply GOT to be)

Edit:
Oh, and this is a Collaborative effort, so everyone should feel free to make their own suggestions on how the algorithm should work! There are certainly even more elaborate ways to randomize the alphabets, should we use them? Does the transposition step really add anything? Would double transposition be worth the effort? Is the entire concept of this cipher flawed? And, now that I think of it, does pulling the collumns for the checkerboard in alphabetic order actualy REDUCE the randomness? Lots of room for discussion and development here.

Also, Insecure, what language are you working in? C++ or Java? I'm more comfortable with Java, but, hey, all programming languages are turing machines.
Well, except for RPG, that was the only "language" I could never wrap my brain around. The entire flow of the program shouldn't shift because I put a 1 in collumn 120 instead of 121. Ick!!!!


Donald
Offline Profile Quote Post Goto Top
 
insecure
Elite member
[ *  *  *  *  * ]
In my experience, one of the biggest problems in software development is that of an unclear specification, so I want to be sure - if I'm going to code this - that I'm coding the right thing. Your specification is now split across at least three articles - hardly your fault!, but nevertheless true. The first article was beautifully clear, and included an excellent example worked both forwards (enc) and backwards (dec), but the mods have muddied the waters somewhat.

It would be a big win for those who wish to code this, or even just to use it, if you could re-present the algorithm in the same style as your first article, but with the mods in place, as if you'd thought of doing it that way to start off with.


To answer your language question, I favour the C language, since I can generally code pretty well anything (all right, anything I understand!) very quickly in it, and of course because it's portable between my OS and that other one that so many people seem to be using nowadays - you know, the one shipped by that chap from Washington State, whose name escapes me right now. But I can grok other languages if need be.
Offline Profile Quote Post Goto Top
 
Donald
Elite member
[ *  *  *  *  * ]
For keywords 1 and 3 pulling off by alphabetic order is a STUPID STUPID idea. darn stupid. I'm an idiot.

BUT, after some playing around, I think I came up with a system that randomizes the alphabets pretty well. It looks a bit nasty at first, but it's really not that complicated once you get your brain wrapped around the idea.

So, yet another attempt at a specification:

Code:
 

To make this system work you need 3 keywords.
Keyword advice:
keyword 1 and 3 should include numbers.  Consider two words joined by a number, with at least one of the words not in a dictionary.
keyword 2 can be alpha only.

For our example, lets pick
Keyword 1=rudolph13amfiog
Keyword 2=stinky          
Keyword 3=elephant214kandar

Use Keyword 1 to create a scrambled alphabet by removing any duplicate letters or numbers from the key, write down the key, then under the key, write the remaining alphabet (leaving out all letters and digits in the key), using the following rule:

If the last character of the key is a letter:
 Start with the first letter after the last letter of the key.  Then, when you hit the end of the alphabet, put in the remaining digits from 0 to 9.  After the digits, start over at the begining of the alphabet and put in the rest of the letters until you get back to where you started.

If the last character of the key is a digit:
 Start with the first digit after the last digit in the key.  Then, when you hit the end of the digits (9), put in the remaining letters from A to Z.  After the letters, start over at the beginingof the digits and put in the rest of the digits until you get back to where you started.
 
Of course, it is possible that the arrangment of a keyword may force you to start at the begining of the alphabet or digits, in which case when you hit the end, there will not be any characters left at the begining to cycle back to.  This shouldn't be a problem since it just adds one more type of mixed alphabet to our list.

Once you have written down all 36 characters in the order specified by the above rules, strip them off by collums to obtained your mixed alphabet.

RUDOLPH13AMFIG
JKNQSTVWXYZ024
56789BCE

RJ5UK6DN7OQ8LS9PTBHVC1WE3XAYMZF0I2G4  <-stripped off by collumns


put into 6*6 Square to obtain checkerboard. Label collumns and rows A-F


   A B C D E F  (key #1 checkerboard)
   -----------
A |R J 5 U K 6
B |D N 7 O Q 8
C |L S 9 P T B
D |H V C 1 W E
E |3 X A Y M Z  
F |F 0 I 2 G 4  

Do the same thing with keyword 3,

ELPHANT214KDR  
SUVWXYZ035678
9BCFGIJMOQ

ES9LUBPVCHWFAXGNYITZJ20M13O45QK6D7R8

   A B C D E F  (key #3 checkerboard)
   -----------
A |E S 9 L U B
B |P V C H W F
C |A X G N Y I
D |T Z J 2 0 M
E |1 3 O 4 5 Q
F |K 6 D 7 R 8


To encrypt your message, we start with key #1 checkerboard.  Find each character from your message in the checkerboard and write down its row and collumn (in that order)

   A B C D E F  (key #1 checkerboard)
   -----------
A |R J 5 U K 6
B |D N 7 O Q 8
C |L S 9 P T B
D |H V C 1 W E
E |3 X A Y M Z  
F |F 0 I 2 G 4  

s  e  n  d  h  e  l  p  a  t  o  n  c  e   <-our secret message
BC FD BB AB AD FD AC DC CE EC DB BB CD FD  <-encrypted version

Now take keyword #2.  List your message under it horizontally.

4 5 1 3 2 6  <-alphabetical order of keyword #2
S T I N K Y  <-keyword #2
-----------
B C F D B B  <-our encrypted message from the previous step
A B A D F D
A C D C C E
E C D B B B
C D F D


Pull the message off by collumns, by alphabetical order of the keyword.  Repeat letters should count from left to right.  (so if you have two R's,the R to the left goes first, then the r to the right)

FADDFBFCBDDCBDBAAECCBCCDBDEB <-The new scrambled encrypted message!

Split this up into pairs and now use key #3 checkerboard to DECRYPT back from pairs into ordinary characters.

   A B C D E F  (key #3 checkerboard)
   -----------
A |E S 9 L U B
B |P V C H W F
C |A X G N Y I
D |T Z J 2 0 M
E |1 3 O 4 5 Q
F |K 6 D 7 R 8

FA DD FB FC BD DC BD BA AE CC BC CD BD EB  <-from previous step
B  2  F  I  Z  N  Z  S  1  G  X  J  Z  W   <-our new result

split result into 5 letter groups and there you go!
B2FIZ NZS1G XJZW

To decrypt, reverse the entire process.

Use the key #3 checkerboard to translate into row/collumn letters

B  2  F  I  Z  N  Z  S  1  G  X  J  Z  W
fa dd fb fc bd dc bd ba ae cc bc cd bd eb

Then count the total number of characters and divide by the number of letters in your second keyword.  From this you can figure out how many letters should be in each collumn, and how many collumns will be short one letter.  Put the character under the keyword in the order of the letters.

4 5 1 3 2 6
S T I N K Y
-----------
b c f d b b
a b a d f d
a c d c c e  
e c d b b b  
c d f d                        

yank back off by rows.  split into pairs and use the key #1 checkerboard to translate back into the original message!

bc fd bb ab ad fd ac dc ce ec db bb cd fd
s  e  n  d  h  e  l  p  a  t  o  n  c  e                                        

send help at once!!!!!

Of course, I wouldn't expect this to hold out against the NSA if they really wanted to read it, but I certainly wouldn't want to try and crack this code.
On the negative side, with three encryption steps (not counting creating the checkerboards) it's slow and vulnerable to errors.


And, as before, please do NOT feel that you will be insulting me if you find a weakness or come up with a better idea. That's what "Collaborative" is all about! :)

And, besides, we KNOW this thing has weaknesses. It's not a new idea (it's just a more complex version of the <bifid cipher>), if it was as strong as blowfish or AES, or even DES, they wouldn't have had to work so hard to create those much more complicated modern algorithms.

But, for a pen and paper cipher, I think it would be pretty nasty to crack. What holes are left now that we have (hopefully), improved the randomization of the alphabets? Can we get better than a brute force attack on keyword #3?

Donald
Offline Profile Quote Post Goto Top
 
insecure
Elite member
[ *  *  *  *  * ]
I'll take a more detailed look when I have some time. Well done for spotting a weakness in the mod.

Key Learning Point for newbies: if you want to develop your own cipher, you'll have to learn a thing or two about analysis; just shrugging your shoulders at your apparently random output and thinking "that's uncrackable" isn't good enough. Donald's identification of a weakness in his own idea is in itself a very strong indication that he has - at the very least - a rough idea what he's doing. (In fact, reading his other articles, I get the distinct impression that he is probably the best cryppie in this group so far.)

Donald is also right to draw attention to the fact that it is not insulting or rude for others to point to weaknesses in the algorithm. In fact, to discover such weaknesses might be said to be the purpose of the exercise.


Offline Profile Quote Post Goto Top
 
Donald
Elite member
[ *  *  *  *  * ]
"insecure"
 
I get the distinct impression that he is probably the best cryppie in this group so far

Well, I thank you kindly, but it's HIGHLY unlikely! :) I've been interested in cryptography since I was a little kid, but I've never gotten beyond very simple cryptanalysis. Revelation has written his own stego, you seem knowledgable, lots of other folks here probably understand more crypto than I do. Heck, PulsarSL says he's brand new at this and he's already cracked one of the challanges before I did. :D
Me, I don't even understand what an S Box IS. I'm definitely a rank amature.

Donald
Offline Profile Quote Post Goto Top
 
PulsarSL
Super member
[ *  *  *  * ]
Donald
Sep 13 2005, 12:00 PM
"insecure"
 
I get the distinct impression that he is probably the best cryppie in this group so far

Well, I thank you kindly, but it's HIGHLY unlikely! :) I've been interested in cryptography since I was a little kid, but I've never gotten beyond very simple cryptanalysis. Revelation has written his own stego, you seem knowledgable, lots of other folks here probably understand more crypto than I do. Heck, PulsarSL says he's brand new at this and he's already cracked one of the challanges before I did. :D
Me, I don't even understand what an S Box IS. I'm definitely a rank amature.

Donald

It was uberly simple... I wouldn't know how to even go about cracking anything harder than that.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Community · Next Topic »
Add Reply