use Digest::MD5 qw(md5 md5_hex md5_base64); srand(); $pass = "micz"; $random[0]=int(rand(9)); $random[1]=int(rand(9)); $random[2]=int(rand(9)); $random[3]=int(rand(9)); $num = $random[0].$random[1].$random[2].$random[3]; $concat = $num.$pass; $hash = md5($concat); $response[0] = ord(substr($hash, 2, 1)); $response[1] = ord(substr($hash, 7, 1)); $response[2] = ord(substr($hash, 7, 1)); $response[3] = ord(substr($hash, 9, 1)); $totalresponse = print "Our challenge is $random[0]-$random[1]-$random[2]-$random[3] (psst, the password is $pass) \n"; print "The correct response is $response[0]-$response[1]-$response[2]-$response[3] \n"; exit;