Help for this page

Select Code to Download


  1. or download this
    use Digest::MD5 qw( md5_hex );
    
    ...
    my $secret_key = "foobar";
    my $hash = md5_hex( join ':', $secret_key, md5_hex( join ':', $public_
    +part , $secret_key ) );
    my $session_key = "$public_part:$hash";
    
  2. or download this
    use Digest::MD5 qw( md5_hex );
    
    ...
    my $hash = md5_hex( join ':', $secret_key, md5_hex( join ':', $usernam
    +e, $secret_key ) );
      # Compare it to the hash they gave us.
      unless ( $hash eq $supplied_hash ) { #err }