Good afternoon! I have one question, well, not so important, but for security reasons, I think it is worth solving this problem. So, in my page there are banal "pictures", one might say, in the form:

<img src="путь_к_изображению" /> 

Now, now please tell me how to encrypt the path of the picture? So that there were all sorts of cracks when viewing the html code in the browser, but the pictures were displayed correctly.

I just have very important information in my paths, because of this it is necessary to hide from prying eyes.


url pictures in this form:

 <img src="" /> 

This is an online broadcast ip camera. I'd like to hide the password, address, user ...

    5 answers 5

    Dynamic mirror


    Suppose there are wonderful pages on remote hosts and we want to add them to our namespace (site). For FTP servers, we would use a mirror program that actually manages updates of copies of remote data on the local machine. For a web server, we could use a webcopy program that does similar things over HTTP. However, both of these technologies have one major flaw: a local copy is always as relevant as we run this program. It would be much better if the mirror were not static. There should be full compliance of copies, regardless of the frequency of the launch of this program. Instead, we want a dynamic mirror with automatic data updates when necessary (data updates on a remote server).


    To ensure this feature, we will display a remote page or even a completely remote site into our web space using the Proxy Throughput option (flag [P]):

     RewriteEngine on RewriteBase /~quux/ RewriteRule ^hotsheet/(.*)$$1 [P] RewriteEngine on RewriteBase /~quux/ RewriteRule ^usa-news\.html$ [P] 

      If you have access to a web server setup, then the most appropriate solution would be to drop the pictures into a separate folder and create an alias that redirects all requests for receiving images there. For example, for Apache, you can do this ( mod_alias ):

       AliasMatch ^/image/(.*)$ /my/hidden/privat/path/image/$1 

      or so

       AliasMatch ^/(.*)\.jpg$ /my/hidden/privat/path/image/$1.jpg 

      If this method is not suitable, then you can index the images and write a script that returns the image by its index ( php GD to help), but IMHO is a perversion.

      And the third way is to insert into the code of the page not a link to the image, but already the data itself: Embedding the image (data) directly into the HTML code .

        Even if you make cracks, people will save the web page as a file and the whole picture will be saved ... and what difference will it get from where they were downloaded?

          Even if you encrypt the path, you can track it in the debugger. Try playing with mod_rewrite if you have apache.

          A selection of examples

          • If .htaccess will register a password, will the user work a rewrite? I tried, RewriteEngine on RewriteRule ^. * / Imgcam / 1 $ 80 / ... [L, R = 301] does not work yet. - Vfvtnjd
          • it works ... what you have written is a physical redirection ... read a very useful site , there are many examples - thunder

          Everything, understood, helped me html obfuscator

          • one
            However this is a solution, it serves only to prevent schoolchildren from climbing. - lampa
          • @lampa, what are you hinting at? ))) - Vfvtnjd
          • one
            Well, the first is that I will see a direct link through a browser debugger. But the second is all that follows from the first. - lampa
          • one
            > And in the same place, in the form of parameters, logins-passwords are passed. Isn’t it obvious that you need not to encrypt the URL, but to look for a fundamentally different way? Passwords in the URL is not the place, and while they are there - there is no other meaning to change, from the word "absolutely." - user6550
          • one
            As an option, which takes place to be: an obfuscated flash, which will receive a picture, transfer to base64 and give it via ExternalInterface javascript. The link to the picture can be obtained by deobfuscating the flash, or by scanning tcp. Another option: put a bridge between the client and the IP camera. The bridge takes the picture and then distributes it. But here you need to know the software. Because If you have an accuracy of 100% of the image format mjpeg, then on this issue you need to look towards: mjpeg stream. - lampa