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

こ雲淡風輕ζ 提交于 2019-12-18 09:12:38

问题


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


回答1:


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).




回答2:


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).




回答3:


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




回答4:


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.



来源:https://stackoverflow.com/questions/915786/how-to-write-aes-cbc-pkcs5padding-encryption-and-decryption-with-initialization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!