U
uncle
I have tried hundreds of combos, scanned hundreds of web pages, I
still cannot encrypt with perl and decrypt with ruby. Hell, I can't
even encrypt with perl/ruby and get the same result.
Have tried blowfish, tripledes, des, rc4, you name.
Would love an expert to help out !
Here is one of my many attempts
#===== PERL
#!/usr/bin/perl
use MIME::Base64;
use Crypt::CBC;
my $key = '12345678';
my $iv = '12345678';
my $text = '12345678';
$cipher = Crypt::CBC->new({
'literal_key' => 0,
'key' => $key,
'iv' => $iv,
'header' => 'none',
'padding' => 'standard',
'prepend_iv' => 0});
$encrypted = $cipher->encrypt($text);
$encoded = encode_base64($encrypted);
print "encrypted=$encrypted\n";
print "encoded=$encoded\n";
#===== RUBY
require 'openssl'
require "base64"
require 'cgi'
require 'uri'
key = "23456789"
token = "12345678"
e = OpenSSL::Cipher::Cipher.new 'DES'
e.encrypt key
s = e.update token
s << e.final
puts s
puts Base64.encode64(s)
~
still cannot encrypt with perl and decrypt with ruby. Hell, I can't
even encrypt with perl/ruby and get the same result.
Have tried blowfish, tripledes, des, rc4, you name.
Would love an expert to help out !
Here is one of my many attempts
#===== PERL
#!/usr/bin/perl
use MIME::Base64;
use Crypt::CBC;
my $key = '12345678';
my $iv = '12345678';
my $text = '12345678';
$cipher = Crypt::CBC->new({
'literal_key' => 0,
'key' => $key,
'iv' => $iv,
'header' => 'none',
'padding' => 'standard',
'prepend_iv' => 0});
$encrypted = $cipher->encrypt($text);
$encoded = encode_base64($encrypted);
print "encrypted=$encrypted\n";
print "encoded=$encoded\n";
#===== RUBY
require 'openssl'
require "base64"
require 'cgi'
require 'uri'
key = "23456789"
token = "12345678"
e = OpenSSL::Cipher::Cipher.new 'DES'
e.encrypt key
s = e.update token
s << e.final
puts s
puts Base64.encode64(s)
~