Advertisement
rAthus

SUPER POWERFULL CAPTCHA OMG BULLETPROOF!!1oneleven

Feb 13th, 2020
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. $numbers = array(1,2,3,4,5,6,7,8,9,10,12);
  2. $letters = array("un","deux","trois","quatre","cinq","six","sept","huit","neuf","dix","onze","douze");
  3.  
  4. $rand1 = rand(1,count($numbers));
  5. $rand2 = rand(1,count($numbers));
  6.  
  7. $sign = ($rand1<=$rand2)?'+':(rand(0,3)?'-':'+');
  8. $sign_display = ($sign=='-')?(rand(0,1)?'-':'moins'):(rand(0,1)?'+':'plus');
  9.  
  10. $int = $numbers[$rand1-1]+$numbers[$rand2-1]*(($sign=='-')?-1:1);
  11.  
  12. $challenge = (rand(0,1)?$numbers[$rand1-1]:$letters[$rand1-1]).' '.$sign_display.' '.(rand(0,1)?$numbers[$rand2-1]:$letters[$rand2-1]);
  13. $salt = md5(uniqid());
  14. $checksum = md5($int.$salt);
  15.  
  16. // display $challenge as a question and pass $salt and $checksum in hidden fields, then check that md5(answer.$salt)==$checksum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement