V
Vetrivel Vetrivel
Herewith I have given code of perl encryption and decryption . If i give
123 as
no,the perl , encrypted the data and give it to us.How to do this in
ruby.But If i give 123,the ruby should encrypt the data . The encrypted
data should be same what perl has given.
use Crypt;
print "enter the normal pin\n";
$entered_pin = <STDIN>;
chomp ( $entered_pin );
my $EPin = Crypt::Encrypt ( $entered_pin );
print "Encrypted pin is : $EPin\n\n\n";
print "enter the encrypted pin\n";
$entered_pin = <STDIN>;
chomp ( $entered_pin );
chomp ( $entered_pin );
for ($i=0; $i<=9999; $i++) {
$pin = sprintf("%04d", $i);
$ret = Crypt:ecrypt ($pin, $entered_pin);
if ($ret == 0) {
print "The Pin is $pin\n";
}
}
123 as
no,the perl , encrypted the data and give it to us.How to do this in
ruby.But If i give 123,the ruby should encrypt the data . The encrypted
data should be same what perl has given.
use Crypt;
print "enter the normal pin\n";
$entered_pin = <STDIN>;
chomp ( $entered_pin );
my $EPin = Crypt::Encrypt ( $entered_pin );
print "Encrypted pin is : $EPin\n\n\n";
print "enter the encrypted pin\n";
$entered_pin = <STDIN>;
chomp ( $entered_pin );
chomp ( $entered_pin );
for ($i=0; $i<=9999; $i++) {
$pin = sprintf("%04d", $i);
$ret = Crypt:ecrypt ($pin, $entered_pin);
if ($ret == 0) {
print "The Pin is $pin\n";
}
}