avatar
Database encryption 一问# Database - 数据库
b*u
1
我需要把database里面比较sensitive的东西encrypt起来。
在网上找到了一些东西。基本上都是要写两个简单的function,
one for encrypt, one for decrypt.
然后用的时候,假设ud_MyCrypt is the function name for encrypt,
insert就要write something like:
Insert table1(SSN) values (dbo.ud_MyCrypt('123456789',NULL))
Say ud_MyDecrypt is the function name for decrypt,select就要写成:
select dbo.ud_MyDecrypt(SSN,NULL , 'SecurePassword' ) from table1
这意味着我所有和DB连的东西都得从写。那我就惨了。有没有什么方法能使
encryption totally transparent呢?不用改我的existing SQL statements?
avatar
c*r
2

Use trigger to do this
Alter the table add column that compute the decryption
or define a view.

【在 b******u 的大作中提到】
: 我需要把database里面比较sensitive的东西encrypt起来。
: 在网上找到了一些东西。基本上都是要写两个简单的function,
: one for encrypt, one for decrypt.
: 然后用的时候,假设ud_MyCrypt is the function name for encrypt,
: insert就要write something like:
: Insert table1(SSN) values (dbo.ud_MyCrypt('123456789',NULL))
: Say ud_MyDecrypt is the function name for decrypt,select就要写成:
: select dbo.ud_MyDecrypt(SSN,NULL , 'SecurePassword' ) from table1
: 这意味着我所有和DB连的东西都得从写。那我就惨了。有没有什么方法能使
: encryption totally transparent呢?不用改我的existing SQL statements?

avatar
b*u
3
Thanks a lot for the answer. It did open a window for me. hehe... I read some
spec/FAQs from those encryption software company's website. They suggest the
same thing.
Now my problem is, my application is there already. I need to somehow just
"plug in" the encryption. Usually those software will create a view on the
table that I want to encrypt. Name the view as my table name, and rename the
table to something else. that's a good idea. However I am not sure how to keep
the key constraints. Any id

【在 c******r 的大作中提到】
:
: Use trigger to do this
: Alter the table add column that compute the decryption
: or define a view.

avatar
c*r
4

some
keep
You can still keep your key/referential and other constraints on your
table.

【在 b******u 的大作中提到】
: Thanks a lot for the answer. It did open a window for me. hehe... I read some
: spec/FAQs from those encryption software company's website. They suggest the
: same thing.
: Now my problem is, my application is there already. I need to somehow just
: "plug in" the encryption. Usually those software will create a view on the
: table that I want to encrypt. Name the view as my table name, and rename the
: table to something else. that's a good idea. However I am not sure how to keep
: the key constraints. Any id

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。