A
aktxyz
Ok, so I am trying integrate with someone who is sending me a string
that is triple des encrypted thru perl.
I need to decrypt the string thru ruby.
I have had no luck decrypting, so decided I would try to encrypt in
ruby as a sanity check...of course...I get different results.
HELP please
Here is the perl...then the ruby. Oh yes, and I am so glad there are
no ; in ruby !
#========================= perl
use Crypt::TripleDES;
use URI::Escape;
my $key="AKJSAYOQWOEIQWLEKJQLKNDDOIQQLWEL";
my $token="1234567890";
my $des = new Crypt::TripleDES;
my $string= $des->encrypt3($token,$key);
#print "string=$string\n\n";
$string=uri_escape($string);
print "string=$string\n\n";
#========================= ruby
require 'openssl'
require 'cgi'
require 'uri'
key = "AKJSAYOQWOEIQWLEKJQLKNDDOIQQLWEL"
token = "1234567890"
e = OpenSSL::Cipher::Cipher.new 'DES-EDE3'
e.encrypt key
s = e.update token
s << e.final
puts URI.escape(s)
that is triple des encrypted thru perl.
I need to decrypt the string thru ruby.
I have had no luck decrypting, so decided I would try to encrypt in
ruby as a sanity check...of course...I get different results.
HELP please
Here is the perl...then the ruby. Oh yes, and I am so glad there are
no ; in ruby !
#========================= perl
use Crypt::TripleDES;
use URI::Escape;
my $key="AKJSAYOQWOEIQWLEKJQLKNDDOIQQLWEL";
my $token="1234567890";
my $des = new Crypt::TripleDES;
my $string= $des->encrypt3($token,$key);
#print "string=$string\n\n";
$string=uri_escape($string);
print "string=$string\n\n";
#========================= ruby
require 'openssl'
require 'cgi'
require 'uri'
key = "AKJSAYOQWOEIQWLEKJQLKNDDOIQQLWEL"
token = "1234567890"
e = OpenSSL::Cipher::Cipher.new 'DES-EDE3'
e.encrypt key
s = e.update token
s << e.final
puts URI.escape(s)