Hi
Here is a working copy of code to encrypt / decrypt text based on Crypt::CBC using Rijndael Cipher. This is just to demonstrate that this is possible in perl.
Argument 1 to program is your key eg : 1234 and Argument 2 is a file to store the encrypted text
$perl crypt.pl 1234 crypt.txt
#! /Users/XXX/perl5/perlbrew/perls/perl-5.20.0/bin/perl use strict; use lib "/Users/XXX/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.2 +0.0/darwin-2level/Crypt/"; use Crypt::CBC; #use Crypt::Rijndael; my $cipher = Crypt::CBC->new( -key => $ARGV[0], -cipher => 'Rijndael' ); my $ciphertext = $cipher->encrypt("texttoencrypt"); open(my $fh,">",$ARGV[1]); print $fh $ciphertext; close $fh; my $plaintext = $cipher->decrypt($ciphertext); print "ciphertext " , $ciphertext,"\n"; print "plaintext " , $plaintext,"\n";

In order to get a better understanding of how the Crypt::CBC module works , the options and how to invoke the different methods look no further that metacpan.org where the module is documented.
If you are new to perl ,do skim through perldoc perlintro first, to understand basics about perl and pointers to the larger documentation set.

The temporal difficulty with perl is u need to know C well to know the awesome.else u just keep *using* it and writing inefficient code

In reply to Re: same encrypt word ? by perlron
in thread same encrypt word ? by docofchaos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.