Comments on: ECB vs CBC Encryption https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/ Linux. GNU. Freedom. Wed, 13 Dec 2017 19:29:15 +0000 hourly 1 https://wordpress.org/?v=5.0-alpha-42199 By: Peter G. https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-124256 Thu, 21 Feb 2013 11:39:47 +0000 http://pthree.org/?p=2264#comment-124256 Is it possible to get a visual feedback from a DES / T-DES OR DESX encryption as well?

]]>
By: Aaron Toponce https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-117085 Sun, 28 Oct 2012 14:43:47 +0000 http://pthree.org/?p=2264#comment-117085 Well, first all the commands are already in the post. You just need to reverse them. Second, because I took a bitmap header (54 bytes worth), and placed it on the encrypted data to create the image, there is irreversible data corruption on the encrypted data. For ECB, this won't be a problem. For CBC, it will.

]]>
By: Shailja https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-117084 Sun, 28 Oct 2012 09:46:48 +0000 http://pthree.org/?p=2264#comment-117084 Can you tell me how to decrypt this image , because I tried but it shows some bad magic no
Please reply asap with the command

Thanks

]]>
By: Marcus Klaas https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116893 Sat, 08 Sep 2012 16:11:45 +0000 http://pthree.org/?p=2264#comment-116893 Great post that explained EBC vs CBC really well. Thanks 🙂

]]>
By: Bryan https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116807 Mon, 09 Jul 2012 02:57:46 +0000 http://pthree.org/?p=2264#comment-116807 This is a great demonstration, but I wonder if it might be made more accurate if the first 54 bytes of ubuntu.bmp were not included in the encryption. In the given example, the first 54 bytes are used in encryption, but then thrown away for visualization. It might be better to dd ubuntu.bmp to ubuntu-sans-header.bmp with bs=1 and skip=54. Perform encryption on ubuntu-sans-header.bmp and then append the 54 bytes from ubuntu.bmp as per the current example.

]]>
By: Aaron Toponce https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116560 Mon, 04 Jun 2012 21:54:02 +0000 http://pthree.org/?p=2264#comment-116560 Yes. You're absolutely correct. I'll update the post. Thanks!

]]>
By: Martins Mozeiko https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116559 Sun, 03 Jun 2012 23:32:43 +0000 http://pthree.org/?p=2264#comment-116559 AES-256 doesn't operate on 256-bit blocks at time. AES-128, 192 and 256 all operate on 128-bit blocks at time.
Only difference is in key size. That means expanded key size will be bigger and AES will use more rounds for AES-192/256 than for AES-128. 128 has 10 rounds, 192 has 12 rounds and 256 has 14 rounds

]]>
By: Jim https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116455 Sun, 26 Feb 2012 18:13:19 +0000 http://pthree.org/?p=2264#comment-116455 Fascinating. ECB looks like a terrible idea that should never be used to encrypt anything, as it makes no proper attempt to encrypt "whitespace", or repeated runs of the same data in the input. The BMP clearly shows the effect, but other datasets (documents, audio, whatever) would be affected too.

]]>
By: Aaron Toponce https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116444 Thu, 23 Feb 2012 02:15:07 +0000 http://pthree.org/?p=2264#comment-116444 Tiao- You need a browser that supports viewing bitmaps.

]]>
By: Tiao https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116443 Thu, 23 Feb 2012 01:11:52 +0000 http://pthree.org/?p=2264#comment-116443 I cannot see the images in my bada phone.

]]>
By: Aaron Toponce https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116439 Wed, 22 Feb 2012 12:12:48 +0000 http://pthree.org/?p=2264#comment-116439 shalombi- Yes, this isn't a one-size-fits-all solution. And ECB definitely performs better than CBC in most cases. However, it is important to understand that patterns will emerge from the underlying data if you use ECB. It's simple enough to do this same exercise on binary executables or text files, and see patterns emerge.

Regardless, the illustration with images is to help you understand what is happening with the different block modes.

]]>
By: shalombi https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116437 Wed, 22 Feb 2012 07:56:06 +0000 http://pthree.org/?p=2264#comment-116437 ECB does preserve block structure which in the case of images reveals part of the information encrypted.
However this isn't so much an issue with other types of data where the value lies in the data rather than the structure.

As explained CBC solves this by chaining the encryption but this comes with a performance hit.
So IMHO CBC isn't a blanket solution but must be chosen carefully in regard with the task at hand.

http://www.cse.wustl.edu/~jain/cse567-06/ftp/encryption_perf/index.html#6

]]>
By: Ross https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116436 Wed, 22 Feb 2012 04:16:45 +0000 http://pthree.org/?p=2264#comment-116436 Very clever! Thanks for posting.

]]>
By: Aaron Toponce : Randomize First, Then Encrypt Your Block Device https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116426 Mon, 20 Feb 2012 22:49:35 +0000 http://pthree.org/?p=2264#comment-116426 [...] blog post is in continuation of the previous post, where I showed why you should not use ECB when encrypting your data. Well, when putting down an [...]

]]>
By: anonymous https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116423 Sat, 18 Feb 2012 15:45:07 +0000 http://pthree.org/?p=2264#comment-116423 Thanks for this illustration. That's why some time ago i changed for IRC encryption from FiSH to mircryption which supports CBC

]]>
By: Aaron Toponce https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116419 Fri, 17 Feb 2012 23:54:57 +0000 http://pthree.org/?p=2264#comment-116419 Lonnie Olson- Yeah, that's why I blogged it. I'm hoping to show some illustrations with other attacks on weak algs, so it's easy to understand the "why".

Nathan Macinnes- Works fine here. Don't know what to tell you.

]]>
By: Nathan MacInnes https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116418 Fri, 17 Feb 2012 22:11:50 +0000 http://pthree.org/?p=2264#comment-116418 The images aren't showing up for me.

]]>
By: Lonnie Olson https://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comment-116417 Fri, 17 Feb 2012 19:58:55 +0000 http://pthree.org/?p=2264#comment-116417 Fascinating, I previously understood that CBC was much better, but didn't understand how much so. This visualization of the differences was awesome. Thanks.

]]>