Thursday, June 20, 2013

BB10 cryptography sample application(AES)

Here is the sample working application for BB10. I have used BlackBerry specific API's to encrypt and decrypt.  I have implemented AES and Triple DES algorithms.

Implementing Cryptographic algorithms using API's is easy as we need to use api's directly. But tricky part is conversion of QString to unsigned char*. I struggled a lot and googled , but I could not get the solution. Recently I have seen one sample for encrypting password using md5. In that example, I found the conversion of Qstring to unsigned char * and vice-verse.


So providing here complete working example which may help others.

For Triple Des crypto sample BB10 algorithm refer this link.


Anonymous said...

Hello let me congratulate you for this great example of symmetric cryptography for BlackBerry 10, since like you, I've been looking for examples or specifications for symmetric and asymmetric cryptography in BlackBerry 10.

Would you have any idea how to sift through a graphical interface, the certificates stored in the certificate store of the BlackBerry?, And the selected certificate, Will you know how to use it to sign an arbitrary binary content?.

I will appreciate your help or advice.

Once again, congratulations on your example.

Chanduthedev p said...

I am not clear on question. Can you be more specific on this? So that I can help you.

Anonymous said...

can you put the code up on another hosting site. I cant seem to get a download started from the link


Chanduthedev p said...

Try now. I moved the file to another hosting site. Let me know if you are facing any issue, i will send via mail.

Anonymous said...

thanks, i appreciate it. the new link worked.

any general tips on how to extend this to use aes 256 bit instead of 128?

thanks again

Herahadi A.N. said...

tried to import and build your sample project but i got an error something like bellow:

make[1]: *** No rule to make target `c:/bbndk/target_10_0_9_1673/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc/qmake.conf', needed by `Makefile'. Stop.

how i can solve this issue?

Herahadi A.N. said...

uups sorry for my last question, i got your code working now.
i just have to clean the project before build it and the error disappear. thank you

Herahadi A.N. said...

if my plain text is less than 10 char, whenever i click encrypt button the result is always change. but when my plain text is more than 10 char the result is always the same even i click the encrypt button many times.

how can i make the result is always same for plain text less than 10 char?

Chanduthedev p said...

Hi Herahadi,

Thanks for your comments. Please get the sample code from the github link


yAst@haA said...

I have tried your code to encrypt some character. And then how if I want to encrypt one file? How about technique?

Popular Posts