5
u/kooolk Jul 09 '17
No. Not every cipher mode is appropriate for any use case. Using "strong" cipher mode without understanding it (and how to handle its IV) is how you get weak crypto.
2
2
u/BohrMe Jul 09 '17
CBC should not be used either.
4
u/sablefoxx Jul 09 '17
CBC is a secure cipher mode (assuming you step over a fair number of pitfalls: e.g. IV reuse, no HMAC), it should only be avoided if better cipher modes such as GCM are easily used in its place.
4
u/awesomenesser Jul 09 '17
If you are talking about network traffic then yes you are correct. From what I have read CBC only breaks down when the intruder has access to the drive (for file encryption), and can test the system with their own blocks of data.
I write embedded firmware and CBC is still secure since no intruders will ever have access to the plaintext (they can't watch messages get encrypted). (Depending on the implementation they shouldn't even have access to decrypt their own messages) You do need to use a unique IV during encryption, to prevent patterns across versions.
I will note that I am not an expert and if someone has issue with what I said please let me know.1
u/vamediah Jul 09 '17
CBC breaks down only due to an implementation error, which results in padding oracle attack. Thus in TLS, it's OK as all common implementation are correct.
For homebrewed code, this is precisely the reason why not choose CBC.
Also, never ever reuse IV - I think it should have been better called as nonce.
Reusing IV in CTR mode has catastrophic consequences - 2 XORs with the same data block => you get plaintext.
1
0
Jul 09 '17
[deleted]
2
u/mpyne Jul 10 '17
Funny you should mention that proviso, since cryptographers have developed by now cipher modes that are at least resistant to nonce-reuse. Not necessarily something you want to jump on immediately, but there are things better than GCM coming down the pike.
0
Jul 09 '17
[deleted]
4
u/Mamish Jul 10 '17
I'm not sure what bothers me more: that you'd consider RSA and AES as replacements for each other (when one's symmetric and the other isn't) or that you'd willing use ECB over any other choice.
78
u/TheSlimyDog Jul 09 '17
Upvoted for visibility so someone can tell me what the hell all of this means.