ELE108 Password
Time: 19:20:05 27-Jul-2024
Student No:
Password:
New Password:   
Re-type New Password:

Your new password entries did not match!

Please try again.

Your new password must be at least 5 characters long!

Please try again.

Unable to update files. Please go back and try again.

"; exit(1); } $fp = fopen ($passwdfile, "r"); $passwordok = 0; while(!feof($fp)) { $line = trim(fgets($fp, 4096)); if ($line == "") continue; if (preg_match("/^$StudentNo/", $line)) { list($user,$password, $name) = explode(':',$line); if ($user == $StudentNo) { if ($password == crypt($passwd,substr($password,0,2))) { $passwordok = 1; // Next part to generate a random salt with letters and/or numbers mt_srand((double)microtime()*1000000); $chars = array_merge(range('a','z'),range('A','Z'),range(0,9)); for($i=0;$i<2;$i++) { $salt .= $chars[mt_rand(0,count($chars)-1)]; } // Now encrypt the the password with the random salt $crypted_pwd = crypt($newpwd,$salt); fputs($fp_temp,implode(":",array($user,$crypted_pwd,$name))."\n"); } else { ?>

Password Authentication Failed!

Please try again.

Password Authentication Failed!

Please try again.

Your password is changed successfully.