如何使用ASP Classic在SQL Server数据库中加密和解密高度敏感的信息? [英] How to encrypt and decrypt highly sensitive information in SQL Server database with ASP Classic?

查看:111
本文介绍了如何使用ASP Classic在SQL Server数据库中加密和解密高度敏感的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在检查stackoverflow和google当然是各种各样的问题,但是我找不到任何具体的解决方案:

I have been checking various questions on stackoverflow and of course google, but I can't really find any specific solution to this question:

如何创建一个功能在ASP Classic中加密和解密SQL Server数据库中的高度敏感信息?像fx。一个社会安全号码或类似的东西?

How do I create a function in ASP Classic to encrypt and decrypt highly sensitive information in a SQL Server database? Like fx. a social security number or anything similar?

(或者可以在我的SQL字符串中做)?

(Or is it possible to do in my SQL string?)

是的,我知道如何使用ASP创建一个函数;)

And yeah, I do know how to create a function with ASP ;)

不,我只是不能使用SHA或MD5哈希信息,因为它们只能工作一个办法。我需要它的工作方式!

And no, I just cant hash the information with SHA or MD5, because they only work one way. I need it to work both ways!

更安全,更好! :)

编辑:

之后我发现这个:


Afterwards I found this:

http://www.4guysfromrolla.com/webtech/010100-1.shtml

但我不知道这是否足够安全,会做什么?其中我可以看到,这是两种方式?

But I don't really know if this are secure enough and will do? Of which I can see, it's going both ways?

推荐答案

允许SQL Server处理加密/使用密钥/证书解密。这样,您不必使用ASP自己滚动,并且将该系统的管理保留在数据本身所在的位置。如果您决定移动到另一个平台,还可以不必更新此过程。

It may well be beneficial to allow SQL Server to handle the encryption/decryption using Keys/Certificates. This way, you don't have to roll your own with ASP and the management of this system is kept where the data itself resides. There is also the benefit of not having to update this process should you decide to move to another platform.

在服务器上创建密钥是一个简单的过程,并使用在这一点之后,他们也很简单,例如;

It is a simple process to create the Keys on the server and use of them after this point is also simple, for example;

加密;

OPEN SYMMETRIC KEY mykey DECRYPTION BY CERTIFICATE [mycert]
UPDATE table SET number = EncryptByKey(Key_GUID('mykey'), @number)

解密;

 OPEN SYMMETRIC KEY mykey DECRYPTION BY CERTIFICATE [mycert]
 SELECT CONVERT(varchar, DecryptByKey(number)) AS number FROM TABLE

这可以在这里找到 SQL Server加密简介

这篇关于如何使用ASP Classic在SQL Server数据库中加密和解密高度敏感的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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