prosyslab-classroom / cs348-information-security

60 stars 10 forks source link

[Question][Hw2] Very slight error in `crack` result, and `crack`'s running time #253

Closed leejy12 closed 1 year ago

leejy12 commented 1 year ago

Name: Junyoung Lee

Hi all, I have 2 questions.

I've implemented the crack function, but the result of cracking yesterday.expected has very slight errors. Here is my output:

Yesterday all my troubles seemed so far away.
Now it looks as though they're here to stay.
Oh, I believe in yesterday.

-Suddenly, I'm �lt half the man I used to be.
+Suddenly, I'm not half the man I used to be.
There's a shadow hanging over me.
Oh, yesterday came suddenly.

Why she had to go?
I don't know, she wouldn't say.
I said something wrong.
Now I long for yesterday.

-Yesterday love was such an easy game to play.ZMow I need a place to hide away.
+Yesterday love was such an easy game to play.
+Now I need a place to hide away.
Oh, I believe in yesterday.

Why she had to go?
I don't know, she wouldn't say.
I said something wrong.
Now I long for yesterday.

Yesterday love was such an easy game to play.
-Now I�meed a place to hide away.
+Now I need a place to hide away.
Oh, I believe in yesterday.

Has anyone else experienced these slight errors? If so, I would appreciate any guidance on which part of my code to fix.

Also, what should be the desired running time of crack? On my machine, cracking yesterday.expected takes about 9 - 10 minutes. I wonder if my solution is efficient enough to pass Gradescope's autograder.

Thank you.

KAIST-JongchanPark commented 1 year ago

In gradescope, there is a 120s timeout for each testcases

leejy12 commented 1 year ago

@KAIST-JongchanPark Thank you, looks like I have much work to do. I will close this for now.

bonjune commented 1 year ago

Just FYI... I tried various implementations. The fastest one cracks yesterday test case within a half second, while the slowest one took around 8 minutes. I believe you can improve yours a lot!

Rsln-M commented 1 year ago

My implementation takes 98 seconds in virtual machine. Autograder in gradescope takes an eternity, however, it has been 20 minutes and still going.

leejy12 commented 1 year ago

@Rsln-M I managed to reduce the running time to 0.4s and only then would gradescope autograder pass. I think there are really large test cases.

Rsln-M commented 1 year ago

Yes, I improved performance and it passed all test cases despite still taking a LOT of time. The testcases must be very large. If anyone else can't solve performance issues in "crack", try to optimize "Padding Oracle" as well.