2017-05-11 13 views
0

私はiframeでいくつかのASPページリンクを呼び出しているWebアプリケーションを持っています。 URLとパラメータのデータが機密であるため、パラメータ付きのソースURLを非表示にしたい。 iframeソースを非表示にしたいだけです。 firebugを使うとURLソースを簡単に見ることができるので、私はinspect要素のJavaScriptを無効にしていません。私を助けてください。iframeソースを安全にする方法

+4

これはできません。クライアントはあなたの秘密のURLにHTTPリクエストをしなければならないので、そのURLが何であるかをいつでも発見することができます。 – Pointy

+0

あなたのHTMLを隠したいと思う。あなたができることは、どうにかして難読化することですが、それでも隠されたり保護されたりすることはなく、ただ読むのが難しくなります – SaggingRufus

+0

ありがとう..私のURLリンクを暗号化できますか? –

答えて

0

ASP.NETを手助けすることはできませんが、私はPHPを使って何をすることができるのかを示すことができます。うまくいけば、正しい道を導きます。

<?php 
//contents of the file that includes the iframe 
$password = "foo"; //set your password 
$key = 123456; //this is the id that your iframe needs 
$encryptedString = openssl_encrypt($key, "AES-128-ECB",$password); //encrypt the string 
?> 
<!-- output the iframe and pass the token as a $_GET variabl a la str=$encryptedString --> 
<iframe src="iframegenerator.php?str=<?php echo $encryptedString; ?>" /> 

は今ここにiframegenerator.phpページ

//iframe code 
$password = "foo"; //set your password 
$encryptedString = $_GET['str']; //get the str variable 
$decryptedString = openssl_decrypt($encryptedString,"AES-128-ECB",$password); //decrypt it 
echo $decryptedString; //spit out the contents 

あなたは明らかにfooではなく、強力なパスワードを使用していることを確認しています。

+0

ありがとう..私はこの方法を試します.. @pendo –

関連する問題