Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old April 8th, 2008, 08:06 PM
GorillaGuy GorillaGuy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 3 GorillaGuy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 47 sec
Reputation Power: 0
Question [SOLVED] Help with Simple Cracking Challenge

Hello,

For one of my subjects at university we have been given an assignment in which we had to implement two simple encryption algorithms. These are the Caesar Cipher and the XOR Cipher. I've had no trouble implementing them, however we have been given two "Mystery" files in which they have been encrypted using one of these ciphers and the challenge is to attempt to decrypt the file without knowing the algorithm used or the key.

I should probably mention how the algorithms work. The Caesar Cipher is slightly modified so that a message is considered as a series of bytes rather than letters. The shift length is the key for this algorithm.

The XOR Cipher generates a keystream from a pseudo-random number generator (PRNG) which is the length of the message. The XOR operation is then applied:
ciphertext[i] = plaintext[i] ^ keystream[i];
The key for this algorithm is the seed to the PRNG. The PRNG used is not cryptographically secure, it is a simple linear congruential generator that always generates the same sequence.

I have managed to successfully decrypt the first Mystery file, it was encrypted using the XOR Cipher and the plaintext was simply an ASCII text file. My program simply went through all possible keys for each cipher, decrypted the file and then checked to see if the decrypted result contained valid ASCII bytes.

I'm having more trouble with the second file. We have been told that the plaintext is not a text file but a file of another well known type. I'm pretty sure that the file is encrypted using the XOR Cipher as I have gone through all 255 possible keys for the Caesar Cipher and couldn't find anything.

So far, I have tried to decrypt the file by going through all different keys, decrypting the file and checking the bytes at the start of the file for identifiers that are present in order to tell the file type. I haven't had much luck with this, and I'm sure there's probably a much simpler way to break this, but I can't seem to figure it out.

Is there some sort of property of XOR that could be used to help decrypt this file? Or something to do with PRNG? I feel kind of stupid that I can't figure it out, apparently someone else cracked it the same day that it was released .

Any hints would be much appreciated. I'd prefer hints than full solutions as I'd like to figure this out myself if I can. Oh, the file is 328 bytes long which seems rather small, I'm not really sure what type of file it could be.

NOTE: This isn't for marks, it's just a little extra thing we have been given. I just want to figure it out, it's been driving me crazy.

Hopefully I've given enough information.

Thanks!

UPDATE: I've managed to decrypt the file, thanks for the help . I basically went through all possible keys, decrypted the file and checked to see if the file type was either an image file or zip file. It turned out to be a zip file.

Last edited by GorillaGuy : April 13th, 2008 at 04:33 AM. Reason: Problem is solved

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > Help with Simple Cracking Challenge


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway