[ic] Using GMP on html pages

Jeff Fearn interchange-users@icdevgroup.org
Tue Jul 16 20:38:00 2002


Hi, I am setting up IC to work with an external credit card processor. The 
latest problem is in verifying the origin of the transaction, the modulus 
used to verify the key sent with the message is to large for Safe. I have 
added Require Math::GMP; in catalog.cfg, however I get the following error:

>23/September/2000:19:30:34 +1000] goldstore /cgi-bin/goldstore/Cleared.html 
>Safe: Number too long at (eval 199) line 4.
>
>
>   my $md5, $key;
>     my $mod = new Math::GMP 
>30228595767520873048540026229575593934896515252637120374368681474579105872020814891656341708651907867208299711325987355906532203980728291116828550425080685894217545141988325453206835015167239608707288467753001511407742419843758261549402595503699663267742887352924283703974451847;
>   my $exp = new Math::GMP 40693;
>   my $decryptedSig = new Math::GMP 0;
>   my $digest = new Math::GMP 0;
>
>     # Validate input is from ComSec
>   # Save of Key
>   $key = $CGI->{Key};
>#  delete($params{"key"});
>     # Compute MD5 digest using base64
>   $md5 = Digest::MD5->new;
>   $md5->add($CGI->{RefNum});
>   $md5->add($CGI->{Amount});
>   $md5->add($CGI->{Response});
>   $md5->add($CGI->{AuthNo});
>   $md5->add($CGI->{Audit});
>   $md5->add($CGI->{ErrorMsg});
>
>   $digest = $md5->digest64;
>     # RSA: decrypted = (plain ^ exponent) % modulus,
>   my $decryptedSig = ($key ** $exp) % $mod;
>   if($digest == $decryptedSig){
>	return 1;
>   }
>   return 0;

Has anyone had success in verifying RSA keys within interchange? I have 
checked the  archive and while I found some posts on veryfing that the data 
has not changed, which is done by comparing $key to $digest, I found nothing 
on verifying the originator by decoding $key with the originators publik 
key.

Thanks, Jeff.


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx