- Posts:
- 43
- Group:
- Members
- Member
- #55
- Joined:
- June 21, 2006
|
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
|