Overview
Contains Functions that expose functionality provided by the Java Cryptography Architecture (JCA):
Note: The JCA framework uses different "providers" to implement specific cryptographic algorithms. Provider implementations need to be installed prior to use.
See https://docs.oracle.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html for more details.
is there any documentation to understand more on macsignature()? Is it related to javax.Crypto.Mac class?
From your file it appears you have the you have the java library needed.
ok, maybe we should really develop our own plugin...thank you for your advise
Hi, thank you for your quick answer :) There is a bunch of libaries..
listprovidersandalgorithms.txt
Ok another problem keyencrypt the key argument has to be a AES generated key. Java's SecretKeyFactory can generate this and it looks like that's what it's trying to do for passwordencrypt but unfortunately this plugin does not expose that method. I suggest using another transformation or modifying the plugin. You will discover as we did the plugin doesn't work well and the developer doesn't respond.
In a test rule run listprovidersandalgorithms() and see if you have the java library needed.
Hi,I'm trying to encrypt a password using "AES/ECB/PKCS5Padding" but failed so far.
For example the password is "Test" followed by a timestamp and SALT is "%aaa*+11/r5Testj8"
I would expect something like this:Plain text is: 'Test19.09.2019 10:45:12' Encrypted text is 'S/WAvRLGqQ0HO25DpRYAzoO5ML3ZYbo0UT65lS80yr0='
My approach is:passwordencrypt( cleartext: "Test19.09.2019 09:01:25", password: "Test", salt: keyencrypt(cleartext: "%aaa*+00/r5Test9", key: text2hex("%aaa*+00/r5Test9"), transformation: "AES"), iterationCount: 1000, transformation : "AES/ECB/PKCS5PADDING")
Error: java.security.NoSuchAlgorithmException: AES/ECB/PKCS5PADDING SecretKeyFactory not available
Any help? ThanksYusuf
I can't get the provider argument to work I keep getting "Expression evaluation error at function 'keyencrypt': The provided iv (SunJCE) is not a valid hex string."
keyencrypt( cleartext:a!toJson(value: {ClaimOne:"SECRET" , ClaimTwo: "SECRET" , ClaimThree: "SECRET" }) , key: text2hex("KjEP3N8I4zLmT9n0N/CNuQ==") , transformation : "AES/ECB/PKCS5Padding" , provider: "SunJCE" )
Can you provide example of RSA ?