Computer Science Canada

encryption

Author:  Shyfire [ Fri Aug 26, 2005 1:11 pm ]
Post subject:  encryption

i just wanted toknow if this encryption is any good

could some body please try to crack it and tell me the secret sentence

Author:  Tony [ Fri Aug 26, 2005 3:19 pm ]
Post subject: 

something about me having too much spare time

it looks good though

Author:  [Gandalf] [ Fri Aug 26, 2005 7:24 pm ]
Post subject: 

No, it seems pretty good...

I'm trying to crack it though Wink.

*Update*
Ah, my efforts did not have any effect. I have too little experience in decryption/encryption.

Author:  rizzix [ Fri Aug 26, 2005 8:14 pm ]
Post subject: 

you cant crack somthing so tiny... encrypt a large paragraph written in proper understandable english.. then it will be easier..

Author:  wtd [ Fri Aug 26, 2005 8:15 pm ]
Post subject: 

Ok... is there something especially funky about the text file? I can't open it.

Author:  MysticVegeta [ Sun Aug 28, 2005 8:09 am ]
Post subject: 

Thats the encryption!!!!! LOL! No i am just joking: File Open Status : Ok.
Maybe your notepad is messed up wtd, dont worry you can make a new one in 5 minutes Wink Which language will it be?? C++, OCalm, Haskell? God, i dont even know the names. Confused

Edit: One more question, i am guessing its a sentence and it follows the same encryption style throughout? That means every character that is encrypted follows the same changing of the ordinal values?

Author:  [Gandalf] [ Sun Aug 28, 2005 4:02 pm ]
Post subject: 

Well, a good encryption would have not just something as simple as a changing of ordinal values once.

wtd, here is what I get in the text file:
Quote:
ëÿÿÿ ýÿÿÿ)'6;*:+'1<0+)5,+%#27&6'#-8,'%1(',*9>-=.*4?3.,8/.75DI8H95?J>97C:9

That's everything except two characters which don't copy and paste very well Confused...

And here is my little attempt at encryption:
Quote:
Àú"ž"ž"¡Ë†p"¦'p" Ã²"¦Ãºp"¹p¾ò" Ã¸Ã²"žÃ¼Ë†püp'"¡pöò" pŠúòøpŒ€"¹pŒ€ú" p'"¡pöŠòöƒúøp"¦'pú" Ã¶Å 'ˆŒ"¡" p¤"šÅ’


*edit* Oh, and Mystic, I am sure that wtd doesn't use "Notepad", since he is mostly on Linux Wink.

Author:  Hikaru79 [ Sun Aug 28, 2005 4:23 pm ]
Post subject: 

wtd wrote:
Ok... is there something especially funky about the text file? I can't open it.

Gedit can't open it because it's a binary file, pretty much. You can use 'cat' to see the output though.
EDIT:If it helps anyone who can't open the file, here's the Hex version of the file:
code:
0700 0000 EBFF FFFF 0A00 0000 FDFF FFFF 2927 363B 2A3A 2B27 313C 302B 2935 2C2B
2523 3237 2636 2723 2D38 2C27 2531 2827 2C2A 393E 2D3D 2E2A 343F 332E 2C38 2F2E
3735 4449 3848 3935 3F4A 3E39 3743 3A39

Author:  [Gandalf] [ Sun Aug 28, 2005 4:42 pm ]
Post subject: 

One thing. Since encryption is usually meant to protect something, it is still meant to be read. Are you sure that your encryption is crackable at all? If you randomly replaced all the letters without following some kind of convention then all of this is pointless...

Author:  wtd [ Sun Aug 28, 2005 7:48 pm ]
Post subject: 

Thanks, Hikaru79.

Oh, and MysticVegata: I think what you were referring to was O'Caml, which is short for Objective-Caml.

Author:  Tony [ Sun Aug 28, 2005 9:46 pm ]
Post subject: 

the problem with decrypting as I see it, is that the message could have been encrypted using a very specialized set of instructions.. like replace all the "A"s with "T"s, insert a redundant character after every prime counter positions. Then encrypt the message using whatever method.

I guess my question would be.. how'd one go about figuring out those hardcoded obsticles that are not defined by simple math?

Author:  Cervantes [ Mon Aug 29, 2005 7:22 am ]
Post subject: 

Ask Alan Turing. Wink

Author:  MysticVegeta [ Tue Aug 30, 2005 9:50 am ]
Post subject: 

the simplest encryption i could come up with is the problem in DWITE using the QWERTY encoder. Q encodes to E. E encodes to T. Every time it shifts 2 right places on your keyboard. Bunch of if statements lol.

Author:  Andy [ Tue Aug 30, 2005 6:25 pm ]
Post subject: 

hmm i had an encryption program for my database program.. except its in c++, if u guys want, i can post a sentence and see how many of u can get it.. but its pretty darn hard

Author:  [Gandalf] [ Tue Aug 30, 2005 6:57 pm ]
Post subject: 

Sure. But seeing that the last two we have didn't get solved, I doubt this one will either. I'm actually pretty sure I'm the only one who has tried Wink.

Author:  Cervantes [ Wed Aug 31, 2005 10:21 am ]
Post subject: 

MysticVegeta wrote:
the simplest encryption i could come up with is the problem in DWITE using the QWERTY encoder. Q encodes to E. E encodes to T. Every time it shifts 2 right places on your keyboard. Bunch of if statements lol.

1. A case construct would better suite this purpose than an if structure.

2. Not if you use Ruby! Laughing 5 lines (Of course that could be one really ugly line if I used { } instead of do .. end), and I'm sure wtd could (would?) reduce it even more.
Ruby:

gets.chomp.downcase.each_byte do |i|
  {
    'q' => 'e', 'w' => 'r', 'e' => 't', 'r' => 'y', 't' => 'u', 'y' => 'i', 'u' => 'o', 'i' => 'p', 'o' => 'q', 'p' => 'w',
    'a' => 'd', 's' => 'f', 'd' => 'g', 'f' => 'h', 'g' => 'j', 'h' => 'k', 'j' => 'l', 'k' => 'a', 'l' => 's',
    'z' => 'c', 'x' => 'v', 'c' => 'b', 'v' => 'n', 'b' => 'm', 'n' => 'z', 'm' => 'x',
    ' ' => ',', ',' => '.', '.' => ' '
  }.each do |key, value|
    print value if i.chr == key
  end
end

To decode it, simply change
code:
|key, value|

to
code:
|value, key|


3. Even in Turing, you don't have to write out a bunch of if statements or create a large case construct to get this job done. Here's my Turing solution, in 12 lines:
Turing:

var keyboard := "qwertyuiopasdfghjklzxcvbnm"
var input, output := ""
get input
input := Str.Lower (input)
for input_index : 1 .. length (input)
    for keyboard_index : 1 .. length (keyboard)
        if input (input_index) = keyboard (keyboard_index) then
            output += keyboard ((keyboard_index + 2) mod length (keyboard))
        end if
    end for
end for
put output

Decode by changing the +2 to -2. Unfortunately, this program will not allow encrypting of "b" or decrypting of "w", because
code:
(keyboard_index + 2) mod length (keyboard)

would be zero. You get the idea though...

The rules I used for the Ruby program and the Turing program are slightly different, mind you. The ruby program wraps around each row of the keyboard (p becomes w, not s), whereas the Turing program does not.

Author:  Shyfire [ Sat Sep 03, 2005 3:18 pm ]
Post subject: 

ok thanks all of you for trying to crack this
and yes it can be decoded with my decoder

any who thanks alot

Author:  MysticVegeta [ Sun Sep 04, 2005 11:00 am ]
Post subject: 

goodjob cervantes Smile except the only reason i didnt use it because when last semester, in grade 9, we didnt get to "for" loops when writing the contests, i didnt even know there were loops heh.

Author:  beard0 [ Sun Sep 11, 2005 5:55 pm ]
Post subject: 

Cervantes wrote:

Turing:

var keyboard := "qwertyuiopasdfghjklzxcvbnm"
var input, output := ""
get input
input := Str.Lower (input)
for input_index : 1 .. length (input)
    for keyboard_index : 1 .. length (keyboard)
        if input (input_index) = keyboard (keyboard_index) then
            output += keyboard ((keyboard_index + 2) mod length (keyboard))
        end if
    end for
end for
put output


Kind of messy in the middle:
Turing:

var keyboard := "qwertyuiopasdfghjklzxcvbnm"
var input, output := ""
get input
input := Str.Lower (input)
for input_index : 1 .. length (input)
    output += keyboard ((index(keyboard,input(input_index)) + 2) mod length (keyboard))
end for
put output

Author:  Cervantes [ Sun Sep 11, 2005 6:47 pm ]
Post subject: 

Woops! Embarassed

Although I wouldn't use the term "messy". Yours runs faster, yes, but at the cost of a little expressiveness. Of course, I would use your method for certain. "Less efficient" describes mine better. Smile

Author:  beard0 [ Sun Sep 11, 2005 7:09 pm ]
Post subject: 

Sorry, it's just that I spent August in a physics lab, programming in Assembly, and trying to get a loop in which I needed to count 2 different 20 bit numbers, on an 8-bit processor down to 17 instruction cycles, otherwise it would have missed some of the high frequency pulses it was supposed to be counting. Clarity was thrown out the window while I was working on that.


: