I know as programming languages C and java , and I know that java is slow so for
ID: 647778 • Letter: I
Question
I know as programming languages C and java , and I know that java is slow so for this reason it is not suitable for cryptography applications espacially low level programming (manipulating bits) , so for this reason I turned to C as programming language but C is difficult in some how especially for GUI (graphical interfaces) , inaddition to this there is no byte type . My question is can we integrate C to java . it means when preparing GUI I use java and when programming the application I use C it is my first suggestion for asking you if it is possible and if we will not have a slow runtime. secondly using delphi ruther than C and java so , please advice me I am in adeadline ,and i must take a decision.
Explanation / Answer
Java isn't as fast as C for cryptographic operations, it is a factor of 2 to 10 times slower, depending on the algorithm - according to my 15 year experience. With the current processors that's often a smaller issue than you may think, you can still get very respectable speeds with Java (much higher than with non-native scripting code for instance). That said, most will argue that Java is more cross platform, easier to maintain and more secure than C.
I would seriously propose you develop your application in Java (or for instance C#). Then if your crypto really requires optimization you have plenty of options:
As with any programming language, most of the time when users complain that an application does not fast enough, it is because they use the wrong API, or use the correct API incorrectly.
As SAI Peregrinus correctly says there may be some issues with Java if you want to purge keys and sensitive information from memory. If you need that kind of protection you may want to look at libraries such as NaCl. You could also deploy a HSM (from Java) if you get really serious - about 7 to 8000 dollars worth of seriousness - about crypto.