EncryptByKey 与 EncryptByPassPhrase?
您对 SQL Server 的对称密钥函数有何看法?具体来说,我有两个问题:
哪组函数更好... EncryptByKey 或 EncryptByPassPhrase?
这两个函数都需要某种密码。在典型的 Web 应用程序架构中,该密码应该存储在哪里? (即,硬编码在数据库中的存储过程中,或作为配置设置存储在 Web 应用程序中)
我很想知道这些功能的最佳实践是什么。
What are your thoughts about SQL Server's symmetric key functions? Specifically, I have two questions:
Which set of functions is better... EncryptByKey or EncryptByPassPhrase?
Both functions require a passphrase of some kind. In a typical web-application architecture, where should this passphrase be stored? (i.e., hard coded within a stored procedure in the database, or stored as a configuration setting in the web application)
I'm eager to see what the best practice is for these functions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用密码进行加密更容易,但使用密钥的优点是可以使用内置 SQL 服务器角色来保护密钥。您可以将密钥的使用锁定为仅那些需要访问该数据的用户。
如果您使用证书,则在初始设置期间只需要纯文本,并且可以将其存储在系统外部。同样,证书是一个安全对象,可以锁定。
希望这有帮助。
Encrypting using a passphrase is easier but the advantage of using a key is that the key can be secured using built in SQL sever roles. You can lock down use of the key to only those users that require access to that data.
If you use a certificate then you only need plain text during the initial setup and can store it outside your system. Again, the certificate is a securable object and can be locked down.
Hope this helps.