Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > encrypt with perl, decrypt with ruby, 3 days and counting...

Reply
Thread Tools

encrypt with perl, decrypt with ruby, 3 days and counting...

 
 
uncle
Guest
Posts: n/a
 
      06-14-2007
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)

~

 
Reply With Quote
 
 
 
 
QoS@domain.invalid
Guest
Posts: n/a
 
      06-14-2007

uncle <(E-Mail Removed)> wrote in message-id: <(E-Mail Removed) .com>

>
>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)
>
>~


Feel free to have a look at ShapeShifter on CPAN scripts, something
there may help you out somehow.

http://www.cpan.org/authors/id/Q/QO/QOS/Utilities/

It does seem to me that your key is different in these examples,
afaik the decrypt key needs to match the key used to encrypt.

 
Reply With Quote
 
 
 
 
Michele Dondi
Guest
Posts: n/a
 
      06-16-2007
On Thu, 14 Jun 2007 20:53:02 -0000, uncle <(E-Mail Removed)> wrote:

>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


Crossposting is generally discouraged but by all means this is a
question that may have deserved it...


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
decrypt challenge - perl encrypt with ruby decrypt aktxyz@gmail.com Ruby 1 06-16-2007 01:30 PM
how to encrypt a C data and write a bin file and read a bin at run time and decrypt C data sweety C Programming 9 02-07-2006 05:28 PM
Can one make up one's own cookie encrypt and decrypt keys? Randall Parker ASP .Net 0 12-04-2005 06:55 PM
FormsAuthentication.Encrypt and Decrypt not playing nicely =?Utf-8?B?TWlrZQ==?= ASP .Net 0 08-31-2005 07:59 PM
Can you encrypt and decrypt CDs and CDRWs ? Allen Computer Support 0 10-20-2004 08:14 AM



Advertisments