Re: AES Questions From Another Dummy.
- From: Jean-Luc Cooke <jlcooke@xxxxxxxxxx>
- Date: 30 May 2006 18:46:23 GMT
Larry Lindstrom <nobody@xxxxxxxxxxx> wrote:
ECB, CBC or CFB? It's all alphabet soup to me, and a single
argument to the encrypt and decrypt functions. ECB doesn't seem to
be favored by those who post in this group.
ECB is bad. CBC is the best of the three listed, but beware:
- make sure you use an initialization vector (think of is as a perturbating
agent in encryption to ensure identical texts don't encode to the same result)
... you're on the right track just below ...
Pad the front of the clear text with some random ASCII, probably
16 bytes.
Terminate the text with a zero, then pad out to a multiple of the
block size with random text.
Then encrypt it.
Am I missing anything?
With all the recent news about breaches of computer security and
identity theft, I'm leary of keeping Social Security and credit card
numbers in the database. But customers may want that option. Would
you consider the precautions I've mentioned, together with the advice
I hope to receive from you folks, adequate protection for such
sensitive information?
My suggestion is to use a ready made (and reliable) library which does all this low level stuff for you.
Ideally something that looks like:
ciphertext = AES-128-CBC-Encrypt(plaintext); // ciphertext should be between 32 and 64 bytes larger than plaintext
plaintext2 = AES-128-CBC-Decrypt(ciphertext); // plaintext and plaintext2 should be identical
The increase in size is due to:
a) the use of an IV (random text)
b) the use of a MAC (for authentication and integrity checking)
Deriving a key from a password is a problem you have not addressed. Also, how to pass
the ciphertext/plaintext to/from the users is an open question. Feel free to email
me directly with questions (or post to the group, many helpful people here, and a few
trouble makers).
Cheers,
JLC
--
.
- References:
- AES Questions From Another Dummy.
- From: Larry Lindstrom
- AES Questions From Another Dummy.
- Prev by Date: AES Questions From Another Dummy.
- Next by Date: Re: Block Cipher Applications
- Previous by thread: AES Questions From Another Dummy.
- Next by thread: Re: AES Questions From Another Dummy.
- Index(es):
Relevant Pages
|