I don't know a whole lot about IVs in block ciphers, but they are used in hashing algorithms (MD5, SHS, etc). All hash algorithms that I know of are "cascading" hash algorithms. They take each block (say, 128 bits) of the input and recombine it with the results of the previous block into a hash function. The output of each step cascades and is used in conjunction with the next block. In this way, changing any block will change the output of the hash algorithm.
To start out though, you need an extra block, so that's where the IV comes in. It's combined with the first message block into the first iteration.
______
IV --> | hash | ______
msg[1] --> |_func_| --> | hash |
msg[2] ---------------> |_func_| -->
msg[3] ----------------------------> ...
Most hashing algorithms have a fixed IV, so that everyone agrees that the same file will have the same hash value.
I'm not familiar with CBC, but I seem to recall that if you use a streaming/cascading cipher (where encryption results cascade to affect the next block), you'd also need an IV. If you can choose the IV yourself it will add some extra entropy, like having a longer key size. Also, a streaming cipher will prevent an attacker from detecting identical plaintext blocks from two snippets of ciphertext (unless they use the same IV and are at the very beginning of the plaintext). Of course, the person decrypting the message will need to know the IV you used.
I'm sure someone more familiar with CBC can give you a little more info ;) ...
blokhead
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.