Bouncy Castle implementation on ehs6 | Telit Cinterion IoT Developer Community
May 23, 2017 - 2:23pm, 6797 views
Hi Everyone!
I am trying to implement bouncy castle-s encryption/decryption methods on ehs6, following this tutorial:
http://www.itcsolutions.eu/2010/12/28/how-to-encrypt-decrypt-with-aes-fr...
http://www.itcsolutions.eu/2010/09/03/how-to-use-bouncy-castle-lightweig...
I use the latest lcrypto-j2me-157 packet downloaded from:
http://www.bouncycastle.org/latest_releases.html
I use Eclipse. The project compiles successfully and starts on ehs6 module, but when the encrzpter constructor is called:
AES_BC encrypter = new AES_BC();
the module freezes. I tried oldere bouncy castle versions also, different encoding, the result is allways the same.
Did anybody successfully implemented Bouncy Castle on ehs6 module? Example maybe?
Thank you in advance.
Endre
Hello,
I also tried to include the bouncy_castle souce files, the scenario is the same: .jad and .jar files are created , but when I run it on the module, it crashes with the first constructor from Bouncy castle.
I found the AES_BC class here:
http://www.itcsolutions.eu/2010/12/28/how-to-encrypt-decrypt-with-aes-fr...
However, now I have some debugging info. This exception happens:
java.lang.NoClassDefFoundError: org/bouncycastle/crypto/ExtendedDigest
I googled it, it may have something to do with obfuscation, but when I try to create an obfuscated package, I get a bunch of warnings, and the obfiscated package is not created.
When I build the project (simply, without obfuscation), the jar file gets huge. Sometimes even 4MB.
We tested the TLS connection , it works now with version 1.2, but I am not sure that it was the module update, because we also changed the server certificate as mentioned in my previous comment.
Endre
Hello,
NoClassDefFoundError could mean that the library was not marked for export or it is not compatible with the Java on the module or the particular file was excluded from build. Please look into the MIDlet jar file to see what's there.
If the jar gets so big maybe this library is too big for this device.
Regards,
Bartłomiej