New answers tagged


Is it secure to encrypt with AES CFB mode a plaintext for which the first bytes are known (e.g. %PDF-1.5 for a PDF document) Yes. Known (and even chosen) plaintext is a standard assumption in any moder cipher, including AES-CFB (and CTR, CBC, OFB...). It does not "give too much information to an attacker", and it is not "bad to encrypt documents with known ...


As secure as any. Known headers aren't going to decrease security, but using SHA256 as a KDF will. Use Scrypt; it's many times more secure. And iv = is better as iv = os.urandom(128). It's the same underlying function, and AES' block size doesn't change.


You may notice that the length of the output of the encryption function is the same as the length of the plaintext. That suggests an inherent problem. In order to verify something, we need something else to compare it to. But that something else hasn’t been attached to the ciphertext (or else the length would be different) and wasn’t returned separately ...

Top 50 recent answers are included