kolohe/FirstCryptoDot — Issue #2: ECB Mode Should Not Be Used
Author: tomrittervg
Created: 2011-12-23 03:37:26+00:00
State: open

I *think* but I'm not 100% positive that it's encrypting using ECB Mode. ECB Mode is Bad Mojo.

With a Block Cipher like AES, only so much data can be encrypted in a 'block'. So the message will be chunked up:

Hello_Wo | rld,_my_ | name_is_ | Tom.

ECB mode encrypts each chunk the same way. This is quite bad for messages with repeating parts. Wikipedia explains better than me: http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29

You want to make sure you use something else. The nuances of the different modes is an advanced topic, but the basics is 'Don't Use ECB'.

- http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/crypto/doc-files/encryptingdata.html
- http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/crypto/doc-files/block.html