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
OblivionX; Yes, I'm back
Topic Started: Nov 26 2008, 12:11 AM (108 Views)
oblivion
Member Avatar
Oblivious
[ *  * ]
Hi guys,

It has been a while since I wrote anything here.
My last contribution was the "Oblivion Cipher", and your comments were a good leasson for me.

Now I have done some thinking as I promised and hopefully this is a bit more interesting.
Let me try to explain what I have come up with. Probably nothing new here but here goes :-)

OblivionX
#########

1. Key generation

Two passwords are entered and each is used to create a SHA-hash. I have chosen 512 bits.
We can call the first key "The Mother Key" and the second "The Morph Key".
These two keys are used to create the first key (also a SHA-512 hash) by creating a new string
by mixing the "mother key" and the "morph key".

Example:

Code:
 
Password1[space](becomes[space]the[space]mother[space]key):[space]TestP@ssW0rd1
Password2[space](becomes[space]the[space]morph[space]key):[space]TestP@ssW0rd2

Mother[space]key:[space]23798771B931C6C3ADCB1ADECF117118C5FEE13F55490B322157CFC3944478A8E8A3F0F5C4C9DE5E58A89E9DB6526B34DBB85ED96B08DE36CC258CCCCD800773
Morph[space]key:[space]D05FC6DB3EE3C5637B3737E763A962F87A1C8C93D27D0185AE78FCDFAFA793A3F100E00DB369FE6CE7B375A3895C45CE9548EC3FDF1BDFA63608C4220B2FAB0D

String[space]to[space]hash:

"2D30759F8C767D1BB39E3E13CC65C633A7DBC3B713A7DEE7C6F31A1976121F88C75AF1ECE81C39F35D52479D00B138252A1E5778CFFCCD3F9A4F4A477983AA83
EF81A030FE00F05DCB43C699DFEE56EC5E87AB8397E59AD3B869552C64B53C4ED9B5B4885EECD39F6DBF018BDDEF3A66C3C620588CC4C2C2C0DB820F0A7B703D"

Key1:[space]BF5E88B6739237B231E1C7FF0DF0534AE9C478636A08E57899E3BEE68FC057B029BA7CC865742DAB5F69CF2944F72DF09416C4F6E29CCAA3E972A33D37C7557C



2. Shuffle time :-)

Now when we got the first key we can start the encryption process.
Based on the first character in Key1 we are using pattern B to scramble the first 16 bytes of data.

The patterns* are like arrays containing the values 0 to 31 in a "random" order and tells what position the next 4 bits are going.
So the first 16 bytes are converted into hex which allows us to split the byte in two.

* There are 16 patterns: A-F, 0-9

Example:

Code:
 
Plain[space]text[space]=[space]"Hi[space]Greg,[space]I[space]can[space]n"

Pattern[space]B[space]=[space]25,[space]6,[space]27,[space]0,[space]29,[space]11,[space]30,[space]18,[space]1,[space]14,[space]3,[space]8,[space]5,[space]24,[space]7,[space]26,[space]17,[space]2,[space]19,[space]22,[space]21,[space]4,[space]23,[space]20,[space]9,[space]10,[space]16,[space]31,[space]13,[space]12,[space]15,[space]28

The[space]first[space]16[space]byte[space](hex):[space]486920477265672C20492063616E206E

After[space]being[space]altered[space]according[space]to[space]pattern[space]B:[space]97060682561002266274329674C6E24E


3. Movement

Our first chunk is now altered.
The first 8 bytes are moved to a "staging area" for a later round.
The remaining bytes remains and we fill up with 8 more bytes from the data.
Then we check Key1 again to see what pattern we will use this time, in this case pattern F.

4. Shuffle again Sam

Example:

Code:
 
Plain[space]text[space]=[space]"ot[space]make[space]"

Pattern[space]F[space]=[space]5,[space]24,[space]7,[space]26,[space]1,[space]14,[space]3,[space]8,[space]13,[space]12,[space]15,[space]28,[space]9,[space]10,[space]16,[space]31,[space]29,[space]11,[space]30,[space]18,[space]25,[space]6,[space]27,[space]0,[space]21,[space]4,[space]23,[space]20,[space]17,[space]2,[space]19,[space]22

The[space]next[space]8[space]bytes[space](hex):[space]6F74206D616B6520

Together[space]with[space]the[space]leftovers:[space]6274329674C6E24E6F74206D616B6520

After[space]being[space]altered[space]according[space]to[space]pattern[space]F:[space]D35916076E2F472C4642B6062246667E


5. Movement

This time the first 8 bytes are moved to the result and the rest are staying to be concateneted with the next 8 bytes.

6. Almost done

In case the data that is left is less than 8 bytes it is padded with zero bytes (Maybe a flaw?)
Fortunately in our case it adds up to an even 8 bytes.

Code:
 
Plain[space]text[space]=[space]"it[space]today"

Pattern[space]5[space]=[space]9,[space]10,[space]16,[space]31,[space]1,[space]14,[space]3,[space]8,[space]13,[space]12,[space]15,[space]28,[space]5,[space]24,[space]7,[space]26,[space]21,[space]4,[space]23,[space]20,[space]25,[space]6,[space]27,[space]0,[space]17,[space]2,[space]19,[space]22,[space]29,[space]11,[space]30,[space]18

The[space]last[space]8[space]bytes[space](hex):[space]697420746F646179

Together[space]with[space]the[space]leftovers:[space]4642B6062246667E697420746F646179

After[space]being[space]altered[space]according[space]to[space]pattern[space]5:[space]4BF09607646122644696464762E76672


The movement is the same as in step 5.

7. Final round

We have no more data, but we have 2 pieces of 8 byte each that only were scrambled once.
The leftovers from last round and the first 8 bytes from the first round.

Code:
 
The[space]first[space]8[space]bytes[space]are[space]appended[space]to[space]the[space]remains[space]of[space]last[space]round:

4696464762E766729706068256100226

Pattern[space]E[space]=[space]17,[space]2,[space]19,[space]22,[space]29,[space]11,[space]30,[space]18,[space]13,[space]12,[space]15,[space]28,[space]5,[space]24,[space]7,[space]26,[space]21,[space]4,[space]23,[space]20,[space]25,[space]6,[space]27,[space]0,[space]9,[space]10,[space]16,[space]31,[space]1,[space]14,[space]3,[space]8

After[space]being[space]altered[space]according[space]to[space]pattern[space]E:[space]206276676566262E1479696060287440


From this round all is appended to the result

8. The result

Code:
 
486920477265672C20492063616E206E6F74206D616B6520697420746F646179[space]has[space]become
D35916076E2F472C4BF0960764612264206276676566262E1479696060287440


Now the entire process is repeated but the pointer on the key continues.
If, or rather when, the whole key is used a new one is generated like the first one but with the difference that the mother key is replaced by Key1.


I have not been thinking that much about the patterns or what sizes the chunks or the keys should be.
This is more of an experiment to learn, much like my last cipher. (But I hope this one is better)
Maybe it will be a bit slow. Maybe I should add some kind of substitution on each byte.

What do you think?

P.S. It is kind of late in Sweden so there might be some typos, please disregard them or ask if there is anything wierd
The following statement is true.
The previous statment is false.
Offline Profile Quote Post Goto Top
 
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
I haven't examined your algorithm, yet. I will do so, when I get time. But a couple of thoughts.

Your algorithm uses SHA1 hashes - which means it's a system that can only be performed by computer. That means it's competing with the computer-only crypto systems, DES, AES, IDEA, etc. As opposed to competing with the historical pen-and-paper ciphers, like Vigenere, Playfair, Bifid, et al.

A computer cipher is expected to stand up to a computerized attack. And there's a very simple test that will determine that a computerized attack is possible - the randomness of the output.

If the cryptosystem leaks any statistical information about the plaintext, it can be successfully attacked by computer. That is, if the ciphertext doesn't pass all the standard tests for statistical randomness, it's pretty much a given that there are successful computer-based attacks against it.

Case in point - Bruce Schneier's "Solitaire". http://www.schneier.com/solitaire.html

That someone discovered that the output was shown to be different from random was taken as proof that the cipher had a weakness, even if no one knew what it was.

So if you're looking to evaluate your new cipher, I'd suggest you take a look at the statistical properties of the ciphertext. Does the ciphertext look random? If not, there's most certainly a weakness in there, somewhere.

BTW - the reverse is not true. Just because a cipher that produces non-random output can be assumed to be insecure, you cannot assume a cipher that produces random output is secure. There are plenty of ciphers that produce completely random output that can be quite easily broken. But the check for randomness is an easy way of filtering out candidates for consideration.
When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
Offline Profile Quote Post Goto Top
 
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
Just another quick note. I just did a frequency count on:

D35916076E2F472C4BF0960764612264206276676566262E1479696060287440

'6' appears 16 times. '2' appears nine times. '3', '8', 'B', 'C', and 'D' each appear only once. 'A' doesn't appear at all.

The kappa for a 16-character alphabet should be .0625. That string has a kappa of 0.127. Twice what it should be.

I can't tell you how to break it, but I can guarantee to you that it can be broken.
When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
Offline Profile Quote Post Goto Top
 
oblivion
Member Avatar
Oblivious
[ *  * ]
Thank you jdege for your input.
There is so much to learn and your comments are truly appreciated.
The following statement is true.
The previous statment is false.
Offline Profile Quote Post Goto Top
 
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
Have you considered trying to write a hillclimber against it?

They're pretty simple in design, and are effective at cracking a great many cryptosystems.
When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
Offline Profile Quote Post Goto Top
 
oblivion
Member Avatar
Oblivious
[ *  * ]
I have not until now, so I will Google the term and read about it ;)
Thanks again!
The following statement is true.
The previous statment is false.
Offline Profile Quote Post Goto Top
 
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
http://en.wikipedia.org/wiki/Hill_climbing
http://www.quadibloc.com/crypto/co040502.htm

Rot13's Monosolve is a hill-climber:
http://s13.zetaboards.com/Crypto/single/?p=1124&t=123686


When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · General · Next Topic »
Add Reply