Programming 9

Put your programming skills to the test in these challenges.

Re: Programming 9

Post by Defience on Wed Mar 18, 2009 9:27 am
([msg=20134]see Re: Programming 9[/msg])

KyleAnderson wrote:Um, it looks like this challenge may have changed. Perhaps in the past the challenge was to encrypt something, but now it is to decrypt it?

I can solve the suduku, get the sha1 hash, now I just need to put the encrypted text and the sha1 has I have together and decrypt, but the provided php code is just the encryption part! http://www.jmic.de/img/jm-blowfish.zip doesn't seem to include a "working" blowfish class that can decrypt either. Am I missing something?

I've tried using other blowfish programs none of them seem to handle my keys and cipher properly. And apparently CBC mode uses and IV, and with the provided code it comes from the time. How are we supposed to figure out what the IV was?

Is that part of the challenge? To implement our own CBC mode blowfish decrypter? Seems to be way to out there for me, I must be missing something.

Precisely, my questions are:
*To the people who have solved this one already, did you use an existing blowfish implementation or did you have to make your own?
*What am I supposed to do with the IV?


You can make a simple PHP script that takes the sha1 hash as the key and decrypts the encrypted text. Just add an 'include(" blowfish.php")' line in it. So basically:
your key='your sha1 hash'
your cipher='encrypted string'
have blowfish decrypt
print out the results
User avatar
Defience
Addict
Addict
 
Posts: 1275
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 9

Post by KyleAnderson on Sun Mar 22, 2009 9:03 am
([msg=20321]see Re: Programming 9[/msg])

Like this?
Code: Select all
$text = $blowfish->blowfish_decrypt($cipher); //$text == 'This is plain text'
echo $text;


You get:
Code: Select all
Fatal error: Call to undefined method Blowfish::blowfish_decrypt()


The included code doesn't have a function for decrypting. But that is what I'm asking, but I don't think this challenge is designed to make us write a blowfish decrypting function.
KyleAnderson
New User
New User
 
Posts: 11
Joined: Fri Nov 14, 2008 10:39 pm
Blog: View Blog (0)


Re: Programming 9

Post by Defience on Mon Mar 23, 2009 8:16 am
([msg=20365]see Re: Programming 9[/msg])

KyleAnderson wrote:Like this?
Code: Select all
$text = $blowfish->blowfish_decrypt($cipher); //$text == 'This is plain text'
echo $text;


Yeah, pretty much like that. Include blowfish.php, then you need to set your $key= " "; as well as $cipher= " "; first.
User avatar
Defience
Addict
Addict
 
Posts: 1275
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 9

Post by f3jk3r on Mon Mar 23, 2009 6:12 pm
([msg=20402]see Re: Programming 9[/msg])

In my opinion, this mission is overrated, while number 3 is underrated. I managed to solve this in couple of hours, while with mission 3 I thought I was going bananas :)
f3jk3r
New User
New User
 
Posts: 15
Joined: Sun Aug 17, 2008 7:34 am
Blog: View Blog (0)


Re: Programming 9

Post by KyleAnderson on Mon Mar 23, 2009 8:12 pm
([msg=20408]see Re: Programming 9[/msg])

I feel like no one is reading my posts carefully. The included blowfish.php does NOT include a function for decrypting:

Code: Select all
Fatal error: Call to undefined method Blowfish::blowfish_decrypt()


In order to solve this did you guys have to write your own decrypt function? I feel like that is not the intention of the challenge.
KyleAnderson
New User
New User
 
Posts: 11
Joined: Fri Nov 14, 2008 10:39 pm
Blog: View Blog (0)


Re: Programming 9

Post by TheMindRapist on Mon Mar 23, 2009 9:07 pm
([msg=20409]see Re: Programming 9[/msg])

It obviously isn't included.
Therefore, I am going to take your question as whether other people were able to find premade ones on Google, or whether they needed to code one on their own.
Why don't you try searching for one, and if you can't find one, make your own.
A challenge to solely solve a Sudoku, considering the amount of existing programs online that perform this, seems rather silly, doesn't it?
Image
User avatar
TheMindRapist
Contributor
Contributor
 
Posts: 585
Joined: Mon Apr 14, 2008 4:57 pm
Blog: View Blog (0)


Re: Programming 9

Post by Defience on Tue Mar 24, 2009 8:28 am
([msg=20433]see Re: Programming 9[/msg])

KyleAnderson wrote:I feel like no one is reading my posts carefully. The included blowfish.php does NOT include a function for decrypting:

Code: Select all
Fatal error: Call to undefined method Blowfish::blowfish_decrypt()


In order to solve this did you guys have to write your own decrypt function? I feel like that is not the intention of the challenge.


You answered your own question:
The included blowfish.php does NOT include a function for decrypting:

It doesn't take much to write a simple one.
User avatar
Defience
Addict
Addict
 
Posts: 1275
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 9

Post by KyleAnderson on Thu Mar 26, 2009 3:59 pm
([msg=20622]see Re: Programming 9[/msg])

Ok thank you for answering. I just wanted to make sure that was part of the challenge, and not just some sort of bug or mistake. I will not figure that part out and put the pieces together. Thanks.
KyleAnderson
New User
New User
 
Posts: 11
Joined: Fri Nov 14, 2008 10:39 pm
Blog: View Blog (0)


Re: Programming 9

Post by BAzly on Fri Mar 27, 2009 3:35 am
([msg=20664]see Re: Programming 9[/msg])

I'm running into a weird problem... I think I'm hung up on something stupid. Please do delete something if it's a spoiler of sorts.

I can solve a sudoku and get something like the below:
8,7,6,2,1,9,5,4,3,5,4,3,8,8,5,2,1,9,2,1,9,5,4,3,8,7,6,1,9,8,4,3,2,7,6,5,4,3,2,7,6,5,1,9,8,7,6,5,1,9,8,4,3,2,6,5,4,9,7,8,3,2,1,3,2,1,6,5,4,9,8,7,9,8,7,3,2,1,6,5,4

Sha1 hash is: 3cf98b1755c7670509fea52e8314841f249ce1f0

Base 64 blowfish value: ScyI+wABC/Eh8bsR0WRKIw==

From there... it should be pretty easy to decrypt it, one would think, but it never matches up. The decrypted value I get is:

Ö¬(ºJ

It seems the appropriate length... But I don't seem to ever get it right... If I do my own Blowfish encryption with the same solved sudoku and key, I get a value way larger than the base64 I'm given in the exercise! I'm pretty sure I'm doing it in the correct mode/block size... So I don't know what the deal is. My encrypted value for the sudoku was:

lPf6lbQ4+l0pi0LzkfQfF83ZcYzCbkCxQh3Y3WX9qSosAWAsDKWD7NjUcVJBeQzfCJzM/rRfiaHkdDks+XxGZ+yXOADIKnoWcnKAufGFZc0Ak1hq9sSBIrDvgcRNq37/JX/BPf7Up7vngJJmXqmfzzbzt6Kf4EpU6tEMb3wWaIGnp/VU1ndkFNtymRfWI3ZzPE3/6+XQJuGxJd94EvGvlRU6y4lUJFOnWF2KmeZZ1Ns=
BAzly
New User
New User
 
Posts: 2
Joined: Wed Nov 05, 2008 4:18 am
Blog: View Blog (0)


Re: Programming 9

Post by acskurucz on Fri Mar 27, 2009 9:38 am
([msg=20687]see Re: Programming 9[/msg])

You must use the given encryption method. Look at the functions harder, and write your own decryption.
acskurucz
New User
New User
 
Posts: 29
Joined: Wed Jan 14, 2009 8:31 am
Blog: View Blog (0)


PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests