my $input;
print "Please Enter String to be encrypted or decrypted";
$input = <>;
chomp $input;
my @asciich;
while($input=~ m/(.)/g)
{push @asciich,ord ($1);}
my $count=scalar(@asciich);
print "Ascii values -----> @asciich\n";
for(my $i=0;$i<$count;$i++)
{
if (($asciich[$i] >= 65 && $asciich[$i] <= 77)|| ($asciich[$i] >= 97 &
+& $asciich[$i] <= 109))
{
$asciich[$i] = $asciich[$i]+13;
}
else
{$asciich[$i] = $asciich[$i] - 13;}
}
print "Encrypted values -----> @asciich\n";
foreach(my $i=0;$i<$count;$i++)
{ $asciich[$i]=chr($asciich[$i]);}
print "encrypted output ------> @asciich\t";
|