Re: Newbie question about AES encryption
- From: "TC" <aatcbbtccctc@xxxxxxxxx>
- Date: 31 Oct 2006 00:33:52 -0800
Mark wrote:
I download some free code to create SHA1 hashes and AES encryption.
Using this code I created a program to encrypt strings by first
initializing the cipher with a SHA1 hash of the password, and then
encrypting the data with the password. It seems to work great by
encrypting a string such as "Encrypted String" and a password of
"password" to a resulting string of "J4lgK+NgpWWtXTyWmeNgow==". Now if
I try and decrypt ONLY PART of the encrypted string, say
"J4lgK+NgpWWtXT" with the password "password", part of the string is
decrypted successfully. I get a decrypted result of "Encrypted". This
seems odd. I would think by truncating part of the decrypted string, I
would get a bunch of garbage in the decrypted string.
Is this a cause for concern?
Further to Matthew's answer.
Say you have a 128 bit block encrypted with AES. If you change as
little as a single bit of that block, and then decrypt it, the result
will be totally random. It will not look anything like the original
plaintext block.
So, as I understand it, the full answer is as follows.
(1) Block ciphers (like AES) have "modes".
(2) If you encrypt in ECB mode, you can decrypt each block seperately
from any other block.
(3) Point (2) is generally considered to be a /dis/advantage - not an
advantage.
(4) If you encrypt in other modes, you can /not/ decrypt each block
seperately.
(5) In any case, regardless of mode, if you make /any change/ to the
bits within a single block, the decryption of that block will look like
random data. It will not look anything like the original plaintext
block.
I'm sure that someone else will jump in here, if any of that is wrong.
HTH,
TC (MVP MSAccess)
http://tc2.atspace.com
.
- Follow-Ups:
- Re: Newbie question about AES encryption
- From: Peter van Liesdonk
- Re: Newbie question about AES encryption
- References:
- Newbie question about AES encryption
- From: Mark
- Newbie question about AES encryption
- Prev by Date: Re: Notice: My 2nd crypto book finished :-)
- Next by Date: Re: What does the MAC in IES or ECIES achieve ?
- Previous by thread: Re: Newbie question about AES encryption
- Next by thread: Re: Newbie question about AES encryption
- Index(es):
Relevant Pages
|
|