10 Replies - 14601 Views - Last Post: 27 February 2012 - 08:37 PM

#1 SwiftStriker00  Icon User is offline

  • No idea why my code works
  • member icon

Reputation: 432
  • View blog
  • Posts: 1,596
  • Joined: 25-December 08

Time to guess the code!

Posted 15 February 2012 - 03:15 PM

I was toying around with this concept of encryption, and thought it would be fun to share with everyone in the form of the challenge. I coded it in java, and providing .class files to help you decode it, so that is why I stuck it in the Java Challenge forum.

The Challenge
Decode the following messages
  • 061009240930 1830142409240325
  • 0020 09301710 03241410000010050020110502300310
  • 06301824 03200324 20300040 042005401410 162406201524 003000401635
  • 161015241624 1224062414001510


Some Support
Did you think I would leave you completely in the dark? Of course not. Attached to this post is a Challenge.class file. It has three methods available to you. main(), test(), and guess().

Usage: Challenge <challenge> <solution>

You may run the main without args to get a command line interface walk through while solving the challenges or you can input the same parameters as the test() (see below) to get an answer right away

test( int challenge, String solution )

challenge - the number of the challenge you are trying to solve
solution - your solution to the challenge

guess( String input, String solution )

input - the cleartext message
solution - the encoded message
Hints
Need a little extra help? I will give you some vague hints to possibly point you in the right direction to the design of this code.
Spoiler


A note about the Challenge class
when you download the file, remove the .txt extension. I only did this to upload to </d.i.c>

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: Time to guess the code!

#2 CasiOo  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1371
  • View blog
  • Posts: 3,022
  • Joined: 05-April 11

Re: Time to guess the code!

Posted 15 February 2012 - 07:43 PM

Got the answer for the two first ones at least. I can write up how I found the solutions inside spoiler tags if anyone is interested.

This post has been edited by CasiOo: 16 February 2012 - 05:06 AM

Was This Post Helpful? 0
  • +
  • -

#3 SwiftStriker00  Icon User is offline

  • No idea why my code works
  • member icon

Reputation: 432
  • View blog
  • Posts: 1,596
  • Joined: 25-December 08

Re: Time to guess the code!

Posted 16 February 2012 - 07:48 AM

Please do, I am curious to see how you went about it, and how it may differ from the design. Also if you got the first too, shouldnt be hard to get the next two. Did you use any hints?

18240630 00201524 16240610 181001241000152416101424 00300424 16240610 152016100035

This post has been edited by SwiftStriker00: 16 February 2012 - 07:49 AM

Was This Post Helpful? 0
  • +
  • -

#4 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,276
  • Joined: 28-March 11

Re: Time to guess the code!

Posted 18 February 2012 - 07:11 PM

I kinda cheated. I decompiled the class file to see what the characters were. :-)
Then I created 2 lookup tables with those characters - 1 for the hours, 1 for the mins.

Looped through the string grabbing 2 characters at a time, converted the string number to a DWORD, then used that number for the index in the lookup table.

Did it in Assembly if you are interested.
Was This Post Helpful? 0
  • +
  • -

#5 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,276
  • Joined: 28-March 11

Re: Time to guess the code!

Posted 18 February 2012 - 11:48 PM

View PostSwiftStriker00, on 16 February 2012 - 09:48 AM, said:

18240630 00201524 16240610 181001241000152416101424 00300424 16240610 152016100035


Missed that one,
Spoiler
silly :bananaman:

This post has been edited by GunnerInc: 19 February 2012 - 10:53 AM

Was This Post Helpful? 0
  • +
  • -

#6 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,276
  • Joined: 28-March 11

Re: Time to guess the code!

Posted 19 February 2012 - 12:15 PM

Java forum, yes, but my solution in Assembly since I like challenges:
Spoiler


Once I figure out your algo to encrypt it, I will write an Encrypt function.

This post has been edited by GunnerInc: 19 February 2012 - 12:16 PM

Was This Post Helpful? 2
  • +
  • -

#7 SwiftStriker00  Icon User is offline

  • No idea why my code works
  • member icon

Reputation: 432
  • View blog
  • Posts: 1,596
  • Joined: 25-December 08

Re: Time to guess the code!

Posted 21 February 2012 - 09:09 AM

Actually I love the Assembly approach. And I don't know if you cheated, because I could have protected the code more, I was curious to see if people would have taken that route instead of looking for the pattern.

This post has been edited by SwiftStriker00: 21 February 2012 - 09:11 AM

Was This Post Helpful? 0
  • +
  • -

#8 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,276
  • Joined: 28-March 11

Re: Time to guess the code!

Posted 21 February 2012 - 04:33 PM

I could add a few checks to it, like if the string in is an odd number of characters then add padding to the end, add a check for spaces in more spots and a few other things. ATM, it relies on a properly formated encoded string. But the idea you have is interesting. I will keep playing around with it.
Was This Post Helpful? 0
  • +
  • -

#9 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,276
  • Joined: 28-March 11

Re: Time to guess the code!

Posted 24 February 2012 - 08:29 PM

Ok, had time to work on the encode function. Pass this through your decoder and let me know what it says, if it is correct, I will comment my code and post it, in Assembly of course :-)

1624060011240824 20300040 04301424 16240610 0224060009240910112405100015 0020 06000324 04401125
Was This Post Helpful? 0
  • +
  • -

#10 SwiftStriker00  Icon User is offline

  • No idea why my code works
  • member icon

Reputation: 432
  • View blog
  • Posts: 1,596
  • Joined: 25-December 08

Re: Time to guess the code!

Posted 27 February 2012 - 11:01 AM

Spoiler

Your welcome!
Was This Post Helpful? 0
  • +
  • -

#11 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,276
  • Joined: 28-March 11

Re: Time to guess the code!

Posted 27 February 2012 - 08:37 PM

Ok, as promised here is the code and a console app to test with. I overly commented it. It is MASM source but I took the long way, so it should be easy to convert to another Assembler. I did cheat and used a few MASM macros to get console input and print to console. Hope someone can learn from it and join us on the "Dark Side" MWAHAHAHAHAHAHAAA!!!!!

Attached File(s)


Was This Post Helpful? 3
  • +
  • -

Page 1 of 1