head 1.1; access; symbols; locks root:1.1; strict; comment @# @; 1.1 date 2005.06.14.12.10.31; author root; state Exp; branches; next ; desc @Cows go boo! Not so moo! @ 1.1 log @Initial revision @ text @ #!/usr/bin/perl # This perl script generates a time-sensitive code. A user is redirected to # a download gateway which will evaluate the code, and offer a download if # the code is correct. (+/- 2 minutes clock skew maximum!) # # Jerry Glomph Black RealNetworks June 2005 .... NOT FOR REDISTRIBUTION # use MD5 ; $GlomphMD5Secret = "Lilliburlero" ; ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = gmtime ; $theDate = sprintf ("%02d%02d%02d%02d%02d", $year - 100, $mon + 1, $mday, $hour, $min) ; $ShortDate = sprintf ("%02d%02d%02d", $mday, $hour, $min) ; $md5 = MD5->new ; $md5->add($GlomphMD5Secret) ; $md5->add($theDate) ; print sprintf ("\n%s/%s\n", $ShortDate, $md5->hexdigest) ; %y%m%d%H%M %y%m%d%H%M %y%m%d%H%M %y%m%d%H%M %y%m%d%H%M %y%m%d%H%M %y%m%d%H%M %y%m%d%H%M %y%m%d%H%M %y%m%d%H%M Lilliburlero#timecode# is the timecode and the rollcode is @