1

Are there any negative security implications of setting the private key password (DSA in this case) as a PKCS12 (and then JKS) export password (instead of generating/inventing a new one)? My use case is that I need to export my PEM private key as PKCS12 so that I can convert it into JKS to import it into a Java based system. I'm not interested in storing more than one private key in the PKCS12/JKS key store.

E.g.:

$ openssl pkcs12 -export -in mycert.crt -inkey privatekey.pem -out keystore.p12 
Enter pass phrase for privatekey.pem:
Enter Export Password:
Verifying - Enter Export Password:
2

If the involved software systems do not do anything stupid, then no, it should not cause any particular problem to reuse the password in that case. By "anything stupid" I mean something like reusing a salt value or failing to generate any IV in the proper way. Each of the involved encryption layers (in JKS, for the private key itself, and for the two passwords in PKCS#12) is defined as a stand-alone entity with its own password-to-key derivation (with its own salt), IV and encryption algorithm.

As a generic cautionary measure, you may want to do all this conversion/export/import in a temporary directory on a memory-based filesystem, so that the involved files are not actually written to a physical disk.

  • Thank you Tom. I have no idea whether this is the "correct" answer but I'll mark it correct if no other commenters/answers say something else. :) – stoft Jan 10 '14 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.