使用密码分离数据库

发布于 2025-01-03 12:22:42 字数 184 浏览 4 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

近箐 2025-01-10 12:22:43

您所描述的内容与 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文