Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Feedback/Suggestions
Author Message
eldorado
Involved
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Thu Jun 11, 2009 11:13 am Reply with quote

Just want to know if the captcha system will be improved?
I hear a lot about randomness nowadays , even about entropia. Just an interresting article I read. [ Only registered users can see links on this board! Get registered or login! ]

I just thought of it because when I was typing numbers in the captcha I got the same number appearing in a tooltip (I'm using chrome)

Don't want to read , here it is
Code:
function phptalk_rand($bytes)

 {
  // If OpenSSL random function is supported, we will use it
  if (function_exists('openssl_random_pseudo_bytes'))
   $rand = openssl_random_pseudo_bytes($bytes);
 
  // If we are on Sun Solaris / Unix / Linux this should work
  if (strlen($rand) < $bytes && ($handle = @fopen('/dev/urandom','rb')))
   {
    $rand = fread($handle,$bytes);
    fclose($handle);
   }
 
  // If both failed, let's try Microsoft's CSP
  if (strlen($rand) < $bytes && class_exists('COM'))
   {
    $capi  = new COM('CAPICOM.Utilities.1');
    $random = substr(base64_decode($capi -> getrandom($bytes,0)),0,$bytes);
    unset($capi);
   }
 
  // Everything failed?!
  if (strlen($rand) < $bytes)
   {
    $rand = '';
    for ($a = 0;$a < $bytes;$a += 16)
     {
      $rand .= pack('H*',md5(mt_rand().microtime(true).uniqid('',true).join('',stat(__FILE__)).memory_get_usage().getmypid()));
     }
    $rand = substr($rand,0,$bytes);
   }
 
  return $rand;
 }


or this one if the above doesn't work
Code:
$random = mt_rand().microtime(true).uniqid('',true).join('',stat(__FILE__)).memory_get_usage().getmypid();

$random = md5($random);
$random = base_convert($random,16,10);
$random = (double) substr($random,0,13)+(double) substr($random,14,13);
 
View user's profile Send private message Visit poster's website MSN Messenger
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Thu Jun 11, 2009 12:24 pm Reply with quote

The use of letters is better because the number of possible combinations is greater and therefore less likely to be displayed more than once.

Sorry not technically related to your post, but because you mentioned numbers I thought I would mention it. Wink
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Thu Jun 11, 2009 7:42 pm Reply with quote

Interesting read Smile

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

PostPosted: Fri Jun 12, 2009 2:54 am Reply with quote

Very Interesting...
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Feedback/Suggestions

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©