I get a value of "¡4Ï$²M%®4¬õDšê«˜H" for $decrypted. The value of $encrypted is "ÖäbŸ€ U)ÐÀ&$", which was sent to me through a GET query, encoded as: "%A0%D6%E4b%9F%80%09U%29%D0%C0%26%1A%24". The actual value of $decrypted should, in some way, end up being "This is a test". I've tried simple stuff like MIME::Base64, but I'm pretty much ending up clueless on this. If I go straight through with a regular perl script, with everything done inside, such as this:#!/usr/bin/perl use CGI qw(:all); use Crypt::RC4; use strict; my $encrypted = param("encrypted"); my $decrypted = RC4($encrypted,"mykey"); print "Content-Type: text/html\n\n"; print "<b>Encrypted Data: $encrypted</b><br><br>"; print "<b>Decrypted Data: $decrypted</b><br><br>";
Then the value of $decrypted is proper ASCII. I suspect that part of the problem may be that the encryption operation is taking place on a seperate system that I have no control over running Windows 2k and IIS, with encryption taking place with Visual Basic. Could it be that the two systems use a different output format and I have to do some kind of conversion?my $encrypted = RC4("thisisatest",'This is a test'); my $decrypted = RC4("thisisatest",$encrypted);
In reply to Converting binary from Crypt::RC4 by owlclown
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |