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 encr开发者_开发百科ypt the password string but I do not know where to start. What algorithm? What do I need to do?
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.
You can utilize a plugin, such as Spring Security core plugin. And actually, we often save password hash instead of its encryption.
精彩评论