You are better off using Crypt::CBC when using blowfish and other similar encryption schemes, since it will setup things properly for you. Read perldoc Crypt::CBC, the first example is for using blowfish. From my experience, you need to need to properly set the "padding" for the keys and data, which CBC handles for you. From the NOTES: from perldoc Crypt::Blowfish
NOTES
The module is capable of being used with Crypt::CBC.
You're encouraged to read the perldoc for Crypt::CBC if
you intend to use this module for Cipher Block Chaining
modes. In fact, if you have any intentions of encrypting
more than eight bytes of data with this, or any other
block cipher, you're going to need some type of block
chaining help. Crypt::CBC tends to be very good at this.
If you're not going to encrypt more than eight bytes, your
data must be exactly eight bytes long. If need be, do
your own padding. "\0" as a null byte is perfectly valid
to use for this. Additionally, the current maintainer for
Crypt::Blowfish may or may not release Crypt::CBC_R which
replaces the default 'RandomIV' initialization vector in
Crypt::CBC with a random initialization vector. (to the
limits of /dev/urandom and associates) In either case,
........
I'm not really a human, but I play one on earth.
flash japh
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.