prosyslab-classroom / cs348-information-security

60 stars 10 forks source link

[Question][Hw2] 281/300 #261

Closed frogfrog2 closed 1 year ago

frogfrog2 commented 1 year ago

Name: Jihwan Park

Hello, I'm fixing my code again and again to reduce its running time. Even though it becomes much more efficient than my first attempt, there is NO change in my score. Does anyone know whether 281/300 is due to running time limits? Thanks in advance.

pingpingy1 commented 1 year ago

One tip that helped me was that for very large inputs, the stack frame memory could potentially overflow due to too many recursive calls. Perhaps making the functions tail-recursive could help?

frogfrog2 commented 1 year ago

Finally 300/300! In fact, according to my experience, 281/300 is not due to code's running time, but your advice is helpful enough to even help me deal with some future assignments. Thank you!

Byunk commented 1 year ago

Finally 300/300! In fact, according to my experience, 281/300 is not due to code's running time, but your advice is helpful enough to even help me deal with some future assignments. Thank you!

@frogfrog2 Can you explain about your problem? I'm experiencing similar problem and it seems working well for any arbitrary plain text but do not pass certain test cases in gradescope

frogfrog2 commented 1 year ago

My problem was to assume that something is always true. Finding one assumption that you unconsciously used in the process of padding oracle attack and dealing with it if the assumption does not hold may help you.

otdababy commented 1 year ago

I'm having the same problem right now :( Can we assume that the given parameters are correct? Meaning can we assume that the input parameters are not in unexpected form (e.g. wrong padding, etc.)? If we can't safely assume the conditions, what do we need to return in those cases?

frogfrog2 commented 1 year ago

Input text has no such problems. I think you can find the assumption in the lecture note.

otdababy commented 1 year ago

I just figured out the error. Thank you for sharing your experience! It really did help.