This content has been marked as final. Show 6 replies
So, Java is actually really that slow when it comes to calculating heavy functions and there is no way to speed up process with using only java?
I'm still not some super Java programer so I didn't know about this wrapping of C Libraries into Java? I'll read more about that.
I don't understand what you meant here?
user12155310 wrote:Thanks for fast answer :)
In Oracle 11g you have a Java 1.6 JVM and you can load and run your demo on the database JVM.
I'm not convinced JNI will help. I'm betting that the difference between a JNI and a pure Java solution is small since when Java uses JIT it is very close in speed to writing in C. I have even found situations where Java is faster than C especially when JNI is used because of the JNI overhead.
The basic problem is that the PBKDF2WithHmacSHA1 algorithm is very very slow and since you are forced to use it you are pretty much stuffed.
From the point of view of security making the key generation algorithm slow is a distinct advantage since, as you are finding, it makes brute force attacks more difficult!!!!!!!!!!!
Kayaman wrote:From memory the slowest part of that algorithm is the SHA1 which is used for each iteration in the iteration count. Maybe using inline assembler for just the SHA1 will be all that is needed to make a significant difference. We will have to see but I doubt it will make more than a factor of 2 difference.
I would imagine the C implementation uses inline assembler code to use the most optimized opcodes available. I'm not sure if JIT is able to recognize complex enough structures to compile things into for example SSE3 instructions.