<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AES on Zach Grace</title><link>https://zachgrace.com/tags/aes/</link><description>Recent content in AES on Zach Grace</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 17 Apr 2015 00:00:00 +0000</lastBuildDate><atom:link href="https://zachgrace.com/tags/aes/index.xml" rel="self" type="application/rss+xml"/><item><title>Attacking ECB</title><link>https://zachgrace.com/posts/attacking-ecb/</link><pubDate>Fri, 17 Apr 2015 00:00:00 +0000</pubDate><guid>https://zachgrace.com/posts/attacking-ecb/</guid><description>&lt;p>On a recent engagement, I came across &lt;a href="http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_Codebook_.28ECB.29">Electronic Code Book (ECB)&lt;/a> encrypted data. While there&amp;rsquo;s a plethora of documentation about performing bit flipping in ECB, I couldn&amp;rsquo;t find any decent writeups on how to perform adaptive chosen plaintext attacks to recover ciphertext.&lt;/p>
&lt;p>In ECB mode, each block of plaintext is encrypted independently with the key as illustrated by the diagram below.&lt;/p>
&lt;img alt="ECB encryption.svg" title="ECB encryption - Wikipedia" src="//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/ECB_encryption.svg/601px-ECB_encryption.svg.png" width="601" height="242" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/ECB_encryption.svg/902px-ECB_encryption.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/d/d6/ECB_encryption.svg/1202px-ECB_encryption.svg.png 2x" data-file-width="601" data-file-height="242">
(Source: Wikipedia)
&lt;p>Since each block of plaintext is encrypted with the key independently, identical blocks of plaintext will yield identical blocks of ciphertext. The classic and poignant example of this property is an encrypted image of the Linux mascot, Tux. Below are three images, the original Tux image, an ECB encrypted Tux and a CBC encrypted Tux. The ECB encrypted Tux leaves visible artifacts whereas the CBC encrypted Tux looks like random data.&lt;/p></description></item></channel></rss>