in reply to Re: OTP (S/Key) implementation using just numbers
in thread OTP (S/Key) implementation using just numbers

Thank you for your replies! In case somebody needs some code to get started, here's mine. Please don't scream when you see my perl...

regards, jan
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] (p +sst, the password is $pass) \n"; print "The correct response is $response[0]-$response[1]-$response[2]- +$response[3] \n"; exit;