开发者

Web Browser Control - Page Encryption

I'm developing an app that use built in Web Browser control. This app will use a symmetric key to encrypt and decrypt http content. So, before a web page is shown in the web browser control, it would be decrypted using the symmetric key. For example:

I want to navigate to www.abc.com, and the content of this website is secured using symmetric key, my code would be:

w开发者_Go百科ebBrowser.navigate("http://www.abc.com"); -- to navigate to the website

but how am I going to get the content of that website, decrypt it and show it to the web browser?


Using the standard WebBrowser control in C#.NET I'm not aware of a simple way you could just take the "displayed" encrypted HTML/images/stylesheets/etc and decrypt the stream using your own method before the control/user views it.

Based on your comment that is is a research project and not for real world use (I'd agree with Shaun go with SSL/client certs), here are a couple of ideas:

  1. Implement a local Proxy Service in your C# that does the decryption. Then point your Internet Explorer proxy setting to that (e.g. http://127.0.0.1:8080), as the C#.NET WebBrowser control uses the IE settings.

  2. If you're only encrypting small pieces of content (e.g. some text?) on your page then you could have your webpage wrap the encrypted code within some JavaScript that accesses your local C#.NET decryption code. This can be done by mapping JavaScript's document.external to a class of your choice by setting webBrowser1.ObjectForScripting = new yourDecryptClass()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜