Sunil Kumar Sahoo
Sunil Kumar Sahoo

Reputation: 53667

How to write AES/CBC/PKCS5Padding encryption and decryption with Initialization Vector Parameter for BlackBerry

How to write a BlackBerry program for AES/CBC with Initialization Parameter ecncryption and Decryption and this encryption and decryption should work independent on Programming language Ex= If I encrypt some data using BlackBery I must be able to decrypt the same data using Java Program.

Thanks Deepak

Upvotes: 2

Views: 9348

Answers (4)

Nickolay Olshevsky
Nickolay Olshevsky

Reputation: 14160

Actually, you write your own code for AES algorithm and CBC mode, it is quite simple, around some hundreds of code lines. And, there should be reference implementation in Java language.

Upvotes: 0

Sunil Kumar Sahoo
Sunil Kumar Sahoo

Reputation: 53667

CBCEngine allows you upto 16 bytes for across platform. so donot use CBC. try to use the default supported cipher engine.

I think ECB will be great if you use.

Thanks Sunil Kumar sahoo

Upvotes: 0

Richard
Richard

Reputation: 8920

Have you read this KB article? http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800779/How_to_-_Use_Basic_Encryption.html?nodeid=800640&vernum=0

You will also need to use net.rim.device.api.crypto.CBCEncryptorEngine on top of the AESEncryptorEngine (and similar for decryption).

Upvotes: 1

Anthony Rizk
Anthony Rizk

Reputation: 3666

The decryption half of your question is answered here: decrypting data with AES/CBC/PKCS5Padding using blackberry

It should be easy to figure out encryption using the same pattern (use Encryptor instead of Decryptor engines, etc).

Upvotes: 1

Related Questions