Quantcast

longer AES key and SecretKey checksum calculations with SHA256?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

longer AES key and SecretKey checksum calculations with SHA256?

Lou Wynn
Hi,

I'm evaluating BC to see its capabilities and having two questions:

1. I got the following exception:
org.bouncycastle.openpgp.PGPException: only SHA1 supported for key checksum calculations

when I passed SHA256 to a JcaPGPDigestCalculatorProviderBuilder:

new JcaPGPDigestCalculatorProviderBuilder().build().get(HashAlgorithmTags.SHA1);

But I can use SHA256 in a PGPContentSignerBuilder and JcePBESecretKeyEncryptorBuilder. I'm wondering when I can use SHA256 in all places when creating a PGPSecretKey.

2. When I use AES_192 or AES_256 in a JcePBESecretKeyEncryptorBuilder, I got the invalid key exception:
invalid key: Illegal key size or default parameters
A similiar question here, when is it possible to use AES keys longer than 128.

Thanks very much,
Lou
Loading...