genemu / GenemuFormBundle

Extra Form : Captcha GD, Tinymce, Recaptcha, JQueryDate, JQueryAutocomplete, JQuerySlider, JQueryFile, JQueryImage
587 stars 265 forks source link

Purpose of `md5`ing of a captcha value #429

Closed zerkms closed 8 years ago

zerkms commented 8 years ago
    public function encode($code)
    {
        return md5($code.$this->secret);
    }

What is the reason (from cryptography/security point of view) of applying md5 together with the secret value for the captcha value that is stored in the session?

bamarni commented 8 years ago

If there is a vulnerability on session side (attacker can read or write data), that'd make it harder for him to break the captcha and brute force for example. But it's not really meant to be a security measure, just the way we store it.

zerkms commented 8 years ago

Ok, I see (I don't think it makes any sense though, but anyway).

Thanks :-)