如何加密/解密Grails域类中的列? [英] How to encrypt/decrypt columns in a Grails domain class?

查看:165
本文介绍了如何加密/解密Grails域类中的列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我想介绍一些数据安全性,我想知道是否可以对Grails域类中的特定列进行加密/解密,如果是这样的话最简单的方法是什么?假设我有一个用户类,想要加密ssn号码或者银行帐号,这些都不会作为纯文本存储在数据库中。最好的方法是什么? ?

解决方案

我创建了 jasypt加密插件完成这一切。文档位于链接的bitbucket wiki上,还有演示文稿中的幻灯片我已经给了它的使用。



它可以轻松地注释您的域类,以对要保护的字段进行字段级加密(默认情况下, Bouncy Castle AES加密提供商)。


As i want to introduce some data security i was wondering if it is possible to encrypt/decrypt specific columns in a Grails domain class and if so what the easiest way is to achieve such a thing?

Let say i have a User class and want to encrypt ssn number or bankaccount number so these are not stored as plain text in the DB.. what would be the best approach?

解决方案

I created the jasypt encryption plugin for doing exactly this. Docs are on the linked bitbucket wiki and there's also slides from a presentation that I've given on it's use.

It makes it easy to just annotate your domain classes to do field level encryption on the fields you want to protect (by default with the Bouncy Castle AES encryption provider).

这篇关于如何加密/解密Grails域类中的列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆