Password space is quiet small. Therefore slow hash should be applied to password before using it for encryption.
Should slow hash function (like bcrypt) be applied to password before using it with OpenPGP/GnuPG? Do they do it itself?
Yes. When encrypting a file using a passphrase, they should use a slow hash function to derive the cryptographic key from the password.
Yes, GPG already does do this. See my answer that explains elsewhere how to use GPG with a slow hash, if you need to encrypt a file with passphrase-based conventional encryption. The short version is that I recommend using the following command-line flags:
This asks GPG to use a slow hash function for hashing the password.
|show 1 more comment|
OpenPGP implementations apply hashing of password during S2K process. They allow to tweak algorithm and number of iterations.
By default GnuPG 1.4.12 uses SHA1 for hashing with 65536 rounds. Algorithm can be switched to MD5, RIPEMD160 or SHA2s. Number of iterations can be changed too. Current settings can be viewed by typing
It will be better to use