1

I'm working on my first .net project using .net 4, mvc4 and entity framework. The project is an api for an iOS application.

Unfortunately one of the requirements is that the project be delivered in a zip file with the connection strings pre-encrypted. This would be straight forward using aspnet_regiis except that I have no access to the server, am not allowed to do key exchange and encrypt on first run is also unacceptable to the client. I can however package any dlls I like in the app.

I have pointed out to the client that this only gives the illusion of security since I will have to pack the decrypt code in the app, to no avail.

So now I am trying to figure out how to pre-encrypt the connection strings in web.config in the simplest most straight forward manner. I've searched both here and via google and while I believe that I will need to create a custom provider and encrypt with aspnet_regiis I would really appreciate guidance from the community.

4

1 に答える 1

0

最後にこれを困惑させました。これは問題に対する最良の答えではないかもしれませんが、うまくいきました。

重要なのは、実際に保護されたカスタム構成プロバイダーを構築することでした。ここにあるMS の手順に従います。

それができたら、aspnet_regiis を使用して web.config の接続文字列セクションを暗号化しました。これにより、クライアントが要求した暗号文が得られました。

一番大変だったのは、keyFilePath= の正しいパスを見つけることでした。

それができたら、Keys.txt ファイルをアプリケーションと共にパッケージ化しました (ソリューション エクスプローラーのファイル プロパティで常にコピーを選択することを忘れないでください)。私のカスタム プロバイダーへの参照を追加し (ソリューション エクスプローラーの参照セクションに常にコピーします)、Bob の叔父です。

これが他の誰かに役立つことを願っています。

于 2013-07-11T18:16:39.757 に答える