# Perl Encrypt / Ruby Decrypt

**URL:** <https://www.ruby-forum.com/t/perl-encrypt-ruby-decrypt/160420>\
**Category:** Ruby\
**Created:** [February 16, 2009, 7:18am UTC](https://www.ruby-forum.com/t/perl-encrypt-ruby-decrypt/160420 "2009-02-16T07:18:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manimaran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@manimaran](https://www.ruby-forum.com/u/manimaran)\
**Post date:** [February 16, 2009, 7:18am UTC](https://www.ruby-forum.com/t/perl-encrypt-ruby-decrypt/160420/1 "2009-02-16T07:18:50Z")

</div>

Dear folks,  
I have encrypted string, which was encrypted by following perl code

use Crypt;  
print “enter the normal pin\n”;  
$entered\_pin = ;  
chomp ( $entered\_pin );  
my $EPin = Crypt::Encrypt ( $entered\_pin );  
print “Encrypted pin is : $EPin\n\n\n”;

I want to decrypt the encrypted string through RUBY code, is this  
possible?  
please let me know.

thanks,

---

<div class="post-metadata">

**Author:** ![manimaran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@manimaran](https://www.ruby-forum.com/u/manimaran)\
**Post date:** [February 16, 2009, 10:35am UTC](https://www.ruby-forum.com/t/perl-encrypt-ruby-decrypt/160420/2 "2009-02-16T10:35:09Z")

</div>

Maran Chandrasekar wrote:

> Dear folks,  
> I have encrypted string, which was encrypted by following perl code
> 
> use Crypt;  
> print “enter the normal pin\n”;  
> $entered\_pin = ;  
> chomp ( $entered\_pin );  
> my $EPin = Crypt::Encrypt ( $entered\_pin );  
> print “Encrypted pin is : $EPin\n\n\n”;
> 
> I want to decrypt the encrypted string through RUBY code, is this  
> possible?  
> please let me know.

The answer is “yes” if that perl function does a two-way encryption, or  
“no” if that perl function does a one-way encryption (a.k.a. hash  
function)

So first thing you need to do is to look at the documentation for that  
Perl function, and find out what type of encryption it is using, and  
what algorithm.

[search.cpan.org](http://search.cpan.org) doesn’t turn up any module called “Crypt::Encrypt”, so  
go look where this module came from.

If you post an example of what the PIN 1234 looks like when encrypted,  
we may be able to tell you what it’s doing just from that.
