Let say you encrypt A.jpg and B.jpg , B is just after A in the hard drive.

let say A = 0101 B = 1001

on unencrypted HDD : AB = 01011001

once encrypted : AB = 11111011

if someone know A is the first bits and know A = 0101

would it be easier for an attacker to know the password by comparing the data of both encrypted and unencrypted data ?

so in that case, in a fresh install of Windows 7, if I encrypt it,

wouldn't an attacker compare his windows 7's first bits to find a correlation between my windows 7's first bits and find my password ?

(sorry for my English...)

1 Answer 1


In a properly implemented encryption scheme, comparing the encrypted and unencrypted data does not provide any clues about the password used to encrypt, as you seem to think.

Any high quality Symmetric Encryption algorithm will include an Avalanche Effect so that if even a single bit of the key is wrong, then the entire result will appear random, and therefore not provide any clues. The attacker does not know whether a guessed key is slightly wrong, or completely wrong.

Also note that the Encryption/Decryption Key is actually Derived from the user's Password using a Key Derivation function. The purpose of using a Key Derivation function is to create a fixed-length key (i.e. 128 bit key for an AES-128 encryption) based on a variable length password (i.e. most passwords are less than 128 bits), including its own avalanche effect. Also the Key Derivation function is usually somewhat processor intensive to reduce the amount of Entropy required for a password to be safe from brute force.

(In your example, it seems you have a XOR cipher, which does not include an avalanche effect.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .