b******u 发帖数: 676 | 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? | c******r 发帖数: 512 | 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?
| b******u 发帖数: 676 | 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.
| c******r 发帖数: 512 | 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
|
|