Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I've noticed that when I encrypt something using Crypt::CBC in the resulting string are always the same over multiple executions (using the same passphrase). The remainder of the string is always random. What is going on here? :)
#!/usr/bin/perl use Crypt::CBC; my $cipher = Crypt::CBC->new( -key => 'my secret key blah blah', -cipher => 'Blowfish', ); my $ciphertext = $cipher->encrypt_hex("This data is hush hush blah bla +h"); my $plaintext = $cipher->decrypt_hex($ciphertext); print "$ciphertext\n$plaintext\n";
$ perl t.pl 53616c7465645f5f27aad01783d47f045a963683bb06e3aa959fc83d7c94e1f5aad894 +d37c8df0d93abaaa80fb9e073b9555761f85204457 This data is hush hush blah blah $ perl t.pl 53616c7465645f5fe7e7d95a83e54fb5f8bfc966d07bff9c3db436a17693bad1c31a85 +766026d5f107d5c17adb017b0eeb46afa6f2d6e462 This data is hush hush blah blah $ perl t.pl 53616c7465645f5fec4cc8f6fc8ecbd4ebdeb938b7d4fe0cf028d3eed7a4dce694e001 +0e8cd99a94e799e3241a41d466a6755999bdb58e5f This data is hush hush blah blah $ perl t.pl 53616c7465645f5f639d36c6f916256557b485abb9c26837b235764faa361d2df38484 +42e58ea52bbbff329a3deb6d182d2b4cf04573e016 This data is hush hush blah blah $ perl t.pl 53616c7465645f5fda138a9a74e5c8c3081430fd3b895de307c1c303fbf48afa2d12bd +8c7097d2a3d600819f4c46fb16702536e97d27211c This data is hush hush blah blah

In reply to Crypt::CBC how does the header/salt work? by Anonymous Monk

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!
  • 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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (3)
    As of 2015-07-28 02:37 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (251 votes), past polls