The plugin has jasypt dependencies and they are exported to app (plugin dependencies are transitively available to the app by default).
I think you can use the StandardPBEStringEncryptor as is based on your config.
Add the below method as an action in a sample controller (inject grailsApplication
) of your app and hit it.
def standard(){
def jasyptConfig = grailsApplication.config.jasypt
org.jasypt.encryption.pbe.StandardPBEStringEncryptor stringEncryptor =
new org.jasypt.encryption.pbe.StandardPBEStringEncryptor(jasyptConfig)
def encrypted = stringEncryptor.encrypt("Hello World")
def decrypted = stringEncryptor.decrypt(encrypted)
render([encrypted: encrypted, decrypted: decrypted] as JSON)
}
or just run the above method in grails console
.