Hi,
Thanks for the effort put on providing a straightforward library for encryption/decryption purposes.
At least when using bouncy castle provider the subject stands true. Here is the test case:
----ENVIRONMENT-----------------
Runtime: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.11-b03
----ARGUMENTS-------------------
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
input: This is a test
password: 1234567
providerClassName: org.bouncycastle.jce.provider.BouncyCastleProvider
----OUTPUT----------------------
+uXF0ZOFIv6tW0RwGUhdloJF6s9V1tubiNG3IRswI5c=
6.However running it for a longer password does not work:
$ ./encrypt.sh "input=This is a test" password=$password algorithm=PBEWITHSHA256AND128BITAES-CBC-BC providerClassName=org.bouncycastle.jce.provider.BouncyCastleProvider
----ENVIRONMENT-----------------
Runtime: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.11-b03
----ARGUMENTS-------------------
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
input: This is a test
password: 12345678
providerClassName: org.bouncycastle.jce.provider.BouncyCastleProvider
----ERROR-----------------------
Operation not possible (Bad input or parameters)
This is only related to bouncy castle BTW. With the weak PBEWithMD5AndDES algo it works for very long passwords indeed.
$ ./encrypt.sh "input=This is a test" password=$password algorithm=PBEWithMD5AndDES
----ENVIRONMENT-----------------
Runtime: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.11-b03
----ARGUMENTS-------------------
algorithm: PBEWithMD5AndDES
input: This is a test
password: 1234567890123456789012345678901234567890
----OUTPUT----------------------
Pw/HSwFPFw5nltGjs10IW54R5j8RTga3