Secure authentication using Active Directory
Problems with external Database
Display Custom Fields on Profile Page
echo custom field in table on 'time' page?
$temp_ref = md5(uniqid());Above, the uniqid() call obtains a hexadecimal representation of a system time with microsecond precision. For example, we can use this code to quickly produce 2 results:
<?php echo uniqid(); echo "\n"; echo uniqid(); echo "\n";Which may get us something like the following:
603c0759424e5 603c075942501The first 8 hex digits in these results represent seconds. The last 5 represent microseconds. But because we made 2 calls one after another, the seconds match exactly, and microseconds differ only slightly. This provides the attacker with an apportunity to request a token at a known time (seconds) and then use brute-force to guess the microseconds part.
$temp_ref = md5(uniqid());with the following 4 lines of code:
$cryptographically_strong = true; $random_bytes = openssl_random_pseudo_bytes(16, $cryptographically_strong); if ($random_bytes === false) die ("openssl_random_pseudo_bytes function call failed..."); $temp_ref = bin2hex($random_bytes);We can also host Time Tracker for your organization on our servers. If you have any questions feel free to contact us.