Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 57
Registered: ‎05-25-2009
My Device: Not Specified

Problem of encrypting large size files on blackberry

Hi, I tried to encrypte a file of 5MB using the most trivial XOR algorithm using a sentence as a key, however it takes more then 4 miniutes on the Bold machine, which is not acceptable to me. I am sure the code is ok. And I think the problem is due to the slow Java. But I do need one way or another to encrypt the file in 5 seconds, what can i do to make it happen? Can I find a way to call native c code to encrypt it ?

 

Thanks.

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Problem of encrypting large size files on blackberry

Did you try using one of the native encryption methods provided with the RIM API's?

 

 

 

 

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Problem of encrypting large size files on blackberry

Agree with RexDoug.  Also I wonder if you have done any analysis of where the time went when in encrypting your 5 MB file?  For example, if the data was on an SD Card, which I'm guessing is where it is, have you timed just reading and writing the data, I suspect that might be significant?  If you want, please post your encryption code, so that we can have a look at it to see if there are any potential gotchas in the code or methodology.

 

Couple of other points:

1) do you absolutely need to encrypt the data?  if you are sending it via a BES network it probably not necessary. 

2) do you need to encrypt all the data.  For example, if you gzip compress the data, then encrypting just the gzip header makes the file unrecoverable without the key, at least as far as I am aware.