Q:

How do I encrypt a string in a Grails domain class?

For example, I created this domain class:
package loginproject

class User {

    String name
    String password
    Boolean state

    static constraints = {
    }
}

I think it is a good idea to encrypt the password string but I do not know where to start. What algorithm? What do I need to do?

A:

If you need a complete authentication and authorization solution +1 for spring security core plugin. If you just want to encrypt a domain class or parts of it in the DB, go for http://www.grails.org/plugin/crypto.

