2

中央のリモート データベースに接続するアプリケーションを作成したいと考えています。このアプリケーションは、複数のユーザーがローカル ネットワーク内のコンピューターで使用できるようにすることを目的としています。私たちにとっての主な課題は、潜在的な悪意のある使用を防ぐために、接続文字列をユーザーから隠すことです。
これまでのところRsaProtectedConfigurationProvider、クラスを使用し暗号化app.configおよび復号化する必要があることがわかりました。しかし、必要な RSA キーをクライアントに与える方法がわかりません。そして、これらすべてが、クラッカーが鍵を見つけてそれを使用して復号化するのをどのように防いでいるのapp.configでしょうか?

みんなありがとう;)

4

3 に答える 3

4

私たちにとっての主な課題は、接続文字列をユーザーから隠すことです

データベースに直接接続するクライアント アプリケーションをユーザーに持たせて、接続文字列を非表示にできるようにすることはできません。これはできません。

接続文字列を秘密にしておく必要がある場合は、それをサーバーに保存し、クライアント アプリケーションがデータベースに直接接続するのではなく、Web サービスに接続できるようにします。

于 2012-08-14T11:27:41.220 に答える
4

If you read through the web farm secenarios of the How To: Encrypt Configuration Sections in ASP.NET 2.0 Using RSA article on MSDN, you will see how to create a key and extract the private and public keys from it in order to install the public key on different machines.

Summary:

  1. Create a custom key:

    aspnet_regiis -pc "CustomKeys" -exp
    
  2. Add a configProtectedData section to the config file, to use the custom key

  3. Encrypt the wanted sections

  4. Export the key:

    aspnet_regiis -px "CustomKeys" "C:\CustomKeys.xml" -pri
    
  5. Copy and import the key in the other machines:

    aspnet_regiis -pi "CustomKeys" "C:\CustomKeys.xml"
    
于 2012-08-14T11:25:00.380 に答える