I'm researching a project that makes use of cryptography. It is a .net application with keys stored in a sql server database. For cryptography, the project uses a Hardware Security Module similar to one described in the linked wikipedia article.
I would like to understand the benefits of using an HSM device instead of doing encryption / decryption / signing / verification and key generation in the .net code using "standard implementation" such as one found in .net BCL. We are talking RSA/DES here.
I would understand if the keys were stored inside the device, but I'm struggling to understand the benefits if keys are stored elsewhere. Sure, you can be sure that encryption algorithm is not tampered with, but if it's tampering that you are afraid of there is plenty of other code that working with the data before it gets encrypted / after it gets decrypted that can be tampered with, and this can be said about almost any project I think.
One possible reason I can imagine is performance, if the application does a lot of cryptography, however I do not know if this is the case for the project yet. So what could be other benefits?