0

I am trying to encrypt a simple string using password based aes encryption using jasypt and I come across in lot of code samples that the algorithm is given as string like "PBEWithSHA512AndAES256-CBC-BC". I am not able to find the document that is relevant to how to understand this string. I understand the parts PBEWithSHA512AndAES256-CBC, but What does the flags BC mean here?

The best resource I could find so far about this is http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyManagerFactory

But still it does not answer my question. I have already googled for 2 hours.

Roman C
  • 49,761
  • 33
  • 66
  • 176
vumaasha
  • 2,765
  • 4
  • 27
  • 41

1 Answers1

1

I Found the answer by inspecting the code of bouncy castle

   /**
     * PBEWithSHA256And128BitAES-BC
     */
    static public class PBEWithSHA256And128BitAESBC
        extends PBESecretKeyFactory
    {
        public PBEWithSHA256And128BitAESBC()
        {
            super("PBEWithSHA256And128BitAES-CBC-BC", null, true, PKCS12, SHA256, 128, 128);
        }
    }

and the definition of the parent class is

   public More ...PBESecretKeyFactory(
23        String algorithm,
24        ASN1ObjectIdentifier oid,
25        boolean forCipher,
26        int scheme,
27        int digest,
28        int keySize,
29        int ivSize)

so, it has the scheme PKCS12, digest SHA256, 128 bit keysize and 128 bit size for initialization vector

vumaasha
  • 2,765
  • 4
  • 27
  • 41