09-09-2009 04:55 PM
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 ?
09-09-2009 06:24 PM
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.