使用密码分离数据库
我正在使用 C# 和 SMO 成功分离和附加 SQL Server 数据库。
我想知道是否可以使用密码保护分离的数据库?最好通过 C# 也欢迎其他建议。我对SQL用户和权限不太熟悉。
(背景:我们使用传输数据库通过承包商将信息传输到没有互联网连接的异地单位。这些数据库包含敏感信息。我们希望精明的承包商不会访问这些信息)
I am using C# and SMO to successfully detach and attach an SQL server database.
I was wondering if it is possible to password protect the detached database? Preferably via C# other suggestions also welcome. I am not too familiar with SQL Users and permissions.
(Background: We use a transfer database to transfer information to offsite units without internet connections via contractors. These databases have sensitive information. We would like that the information not be accessed by a savvy contractor)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所描述的内容与 SQL Server / SMO 或其他任何内容没有任何关系 - 只需使用一些密码和良好的算法(如 AES256)加密您想要传输的文件,并在您和异地设备之间保密密码。每次传输都使用新的加密强度高的密码(切勿使用密码两次!)。
如果您想验证文件未被篡改,请为您传输的每个加密文件创建一个数字签名(使用非对称算法,如 RSA)。您对所有人保密私钥...为了验证签名,公钥就足够了 - 全世界都可以知道公钥,而不会损害您的安全。
What you describe does not have anything to do with SQL Server / SMO or whatever - just encrypt the files you want to transfer with some password and a good algorithm (like AES256) and keep the password secret between you and the offsite unit. Use a new cryptographically strong password for every transfer (never use a password twice!).
IF you want to verify that the file has not been tampered with create a digital signature for every encrypted file you transfer (use an asymmetric algorithm for that like RSA). you keep the private key a secret from everyone... for verification of the signature(s) the public key is sufficient - the public key can be known to the whole world without compromising your security.