Kat, forget len issues, mike posted 1867 len doc as i had not parsed a capital letter, last doc posted is correct, there is still time to win, get bustin that key!
Kat, forget len issues, mike posted 1867 len doc as i had not parsed a capital letter, last doc posted is correct, there is still time to win, get bustin that key!
ok. it will not let me edit it. strlen changed in progies. keep getting four or five different words then nothing fits.
Last edited by kryptkat; 02-13-2010 at 01:47 PM.
What wont let u do what? I think you may be in situation where you need to refactor your code because i think your approach flawed from the outset maybe... And this cipher could be broken quick with just half the char count anyway
I will keep this contest open until 8th March, one user that i am aware of has broken the cipher but has coded in C#, thus i will keep contest open for further seven days, if no improvements are made on the current best effort then i will announce that as winner by default.
spent all weekend trying to figure out why the function was not returning the correct results. for example i would send a 'j' and 'a' which should have returned an 'j' but it returned and 'r'. the function looked correct.
unlike caesar where you have only one rot with this you have several characters that have to fit before anything looks like legible text. even when you find something it may only be accidental and not part of the message or the key. i made a prog that would test keys. found some interesting results.
with the key of 'troll' it returns 'cezar' in the first line but no other text. also found
'snap to a' as the first line again with no other text and
'victory am i' as part of the frst line with no other text. the key must fit before all of the message is displayed. part of the message may be displayed IF and only IF by chance you get a character in the correct spot in the key. with repeats you still have to find what fits .meow or throw fits. but that is what keeps it interesting. . also why it was once considered unbreakable.
thats right, it was once considered unbreakable, and as i mentioned earlier if you encrypt the entire text with a random key of the same length ( as in the one time pad system) it has mathematically been proved unbreakable as even with enough computing power to run all the permutations you would also get all the 'wrong' messages also, you could never be sure which was the right one, no good for intelligence gathering.
well just a few days left so good luck... interesting that cezar was generated as the first word there using troll haha
one time pads can be cracked. you just have to go through all the possible combinations.
that is the easy part. looking through more than 35 giggs of data to find something legible
that is the hard part.
thank you.
The problem is, does the intercepted order read "monday attack cboard" or is it "do not attack cboard"? With a one time pad, both are equally likely, but if you guess wrong, cboard might be destroyed. This is what is meant by a one time pad being unbreakable. You can find the plain text, but you cannot identify it as the plain text with any confidence because there are so many alternatives that are equally likely to be the original plain text, even after you have discarded those that are not.Originally Posted by kryptkat
Last edited by laserlight; 03-02-2010 at 05:03 AM.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
The point is exactly that which has just been reiterated, brute force attack on the one time pad would yield lots of messages that made perfect sense, and thus would be potential candidates for the correct message, thus rendering brute force attack useless.you just have to go through all the possible combinations.
that is the easy part. looking through more than 35 giggs of data to find something legible
that is the hard part.
in any case it is pure fantasy to even consider brute force attack as a method of attack for a one time pad,apart from the reason already mentioned the permutations are gargantuan and even given enough computing resource the time taken to attack it like this renders it redundant.
one time pad is just that, the next message sent is a new random key.
contest entry
prog cvcvigenerecontestentry.cpp
compiles using dev cpp
dejamewie if a key is found for the vigenere the rest of the text should fall in to place and make sense. if the same is true for the one time pad maybe. there is most likely to be an order to do something rather than an order not to do something. aka attack or retreat in lieu of sit there and do nothing.
bruteforcie of only thirteen char was 35 gig file. bruteforcie of only 4 was still 2gig found many with prog that are not part of text message or key. found may parts of words that did not fit eighter. finding the correct characters is still a matter of luck and some intellagence for the message interpatation.
Thanks for entry, see board on monday. You r stil missing point about one time pad though methinks, it is unbreakable in terms of pure math, as a stand alone codebreak, fact the pad could be stolen by your spies is a moot point
I am not sure what you mean by "a key is found", but if rogster001's interpretation is correct then it does not matter, since encryption will always be "broken" if the attacker knows the key - the idea is to keep the key secret.Originally Posted by kryptkat
I suspect that your idea is this: by performing cryptanalysis on part of the ciphertext (e.g., the first block of a block cipher), one might be able to obtain a possible key that results in plausible plaintext. When one applies the decryption algorithm using this key on the rest of the ciphertext, the rest of the plaintext should fall into place and make sense.
The flaw in this with respect to the one time pad is that if you perform cryptanalysis on part of the ciphertext, you only get the possible key material that corresponds to that part of the ciphertext. A one time pad is characterised by the fact that there is at least as much key material as there is plaintext, so that every unit (e.g., bit) of the plaintext is encrypted with a different unit of the key material. Therefore, you cannot apply the decryption algorithm using this key on the rest of the ciphertext, since you do not have the key that corresponds to the rest of the ciphertext.
Furthermore, the key material that you do get is all the possible keys of the length of that portion of ciphertext that corresponds to a message that makes sense. Effectively, you are playing a pure guessing game to guess all sensible messages of that length. This is a rather hopeless task since you simply cannot know which of your guesses is the correct guess, with any confidence at all.
For example, instead of the two messages that I suggested, maybe the message is actually "kill: kryptkat only!". Since you reasoned that the message was "monday attack cboard", you went to the frontline and sacrificed yourself, thus enabling the enemy to easily achieve their objective. Thank you
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Here's my entry. I really have to stop pushing everything ahead of me until the very last minute, I didn't have time to implement all the functions I wanted to include.
compiles with
$ g++ -Wall crypt.cpp -o crypt
for the basic command line version, or
$ g++ -Wall crypt.cpp -o crypt -DUSE_NCURSES -lncurses
for the somewhat improved ncurses gui version. Which also includes the command line functionality of course.
(for windows users; I don't know if ncurses is available as a native windows library or if you have to use cygwin. I have only tested under cygwin and linux.)
Usage:
Decrypt a file, printing to stdout
$ ./crypt d key < inputfile.txt
Encrypt a file, storing the result in another file
$ ./crypt e key < inputfile.txt > outputfile.txt
Replace "key" with the key you want to use for encryption/decryption.
Key analysis (requires compiling with ncurses)
$ ./crypt i
Then press F1 to load an encrypted file, and F2 to determine key length.
The F3 option isn't implemented yet (not enough time) but was planned to assist in cracking the key by scanning for character frequencies, which is how I found the OP's key in the first place. (except in C#)
F10 exits the application.
check. See the i option.
check. See attached "encrypted.txt"part2 > Your program should also be able to encrypt the attached plaintext file using the same ciphertype and key and output it to a .txt file, this file will then be run in my test program.
check. See the first line of crypt.cppinclude the cipherkey as a comment at the top of your source file.
Uhm.. my source uses a lot more than 200 lines so I failed to fulfill this requirement.The winning program will be a single source file, maximum of 200 lines, including empty lines.
For those who don't feel like reading the source just to get the key, it's "basic"
The code has hardly any comments at all, and is quite a mess. (I blame it on being tired, and being high on coffee. It's 5am here) But at least I got a chance to try out ncurses
If anyone has any questions about something then feel free to ask.
Many congratulations to _Mike! He wins the contest!
He has matched the requirements on many of the criteria and actually broke the code itself some weeks ago with the key ' basic ' which he sent by PM to me.
A sterling effort to crack the cipher and a nice bit of code written as response to the problem, also of note is rewriting the original from C#.
thanks to Kryptkat also for additional entry, maybe now you have the key it will all make sense...! :-)
Attached is the source article which was encrypted, i have copied this from the webpage below, for the challenge i reworded some of it to avoid including numbers and also removed whitespace and punctuation etc.
Babbage Difference Engine
thanks to all for interest and comments, i still gonna post that indepth lecture on encryption history and one time pads though!...erm maybe not haha!
cheers!