09 April 2012

Using Electronic Code Book(ECB)

Electronic Code Book is an operational mode for block ciphers . It has an interesting feature that
may effect of the strenghtof your encryption. If you are using ECB with any symmetric algorithm, encrypting two identical plaintext blocks with the same encryption key results the same ciphertext. This provides for attacker to detect blocks which has the same plaintext.

During code reviews take care of using ECB.

Cipher cipher = Cipher.getInstance("AES/
ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, keySpec);


No comments: