Blowfish from CommonCrypto is broken in ECB mode

Originator:neocool2
Number:rdar://12757660 Date Originated:27-Nov-2012 04:19 PM
Status:Open Resolved:
Product:iPhone SDK Product Version:iOS 6.0.1
Classification:Serious Bug Reproducible:Always
 
Summary:

The attached sample project uses CommonCrypto to encrypt and decrypt a string with the Blowfish algorithm. In iOS 5, one could use the option kCCOptionECBMode just fine and still decrypt the correct string. In iOS 6, using the ECB mode results in an incorrect encryption result.

Steps to Reproduce:

Run the attached example project on iOS 6, either a device or the simulator is fine. Some diagnostic output is printed on the debug console.

Expected Results:

Encrypting and later decrypting should give the original input again.

Actual Results:

When using ECB mode, the decryption result doesn't match the original input.

Regression:

The sample project works just fine on iOS 5.

Notes: -

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!