1

i thought to develop a technique in which image's url won't be contained in html source code directly. I want only encrypted urls to be contained in html source code at the client side. I m working on .net with c#. Not able to think where to start with. I also could not find any similar techniques anywhere.

Can anyone suggest me some ideas, that is, where to start with??? Or probably tell me about any similar approach already existing somewhere.

plz reply asap..

Thank you in advance...

2 Answers2

1

I would suggest you not to waste your time with things like this. If the image is ever to be shown in the browser it is a peace of cake to retrieve it with tools such as FireBug no matter how hard you try.

Now if you only wanted authenticated users to see the image you would simply serve it from a server side script which requires authentication:

<img src="/somescript.ashx?id=123" alt="" />

and you configure authentication for the somescript.ashx script so that an unauthorized user cannot directly call it.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • thanx for the suggestion Darin. but its for making my college teachers happy and not for my own web site. furthur i don't have authorized users but just want to restrict their image access. So, i'll appreciate if u help me that way. –  Feb 06 '11 at 10:22
  • @Nitinzz, as I said in my answer this is not possible. Every image that you are showing in a publicly visible web site is very easy to retrieve by anyone. – Darin Dimitrov Feb 06 '11 at 10:28
  • 1
    @Nitinzz, your college teachers don't know this isn't possible? – Kevin Mark Feb 06 '11 at 10:43
0

You may want to look at base64 encoding. It can convert images to encoded string. While it will not entirely prevent people from converting base64-text back to images, it will not directly show up a url, which I guess is your concern.

I am not a .NET user so I would not know about a library to convert your images to base64-encoded text but you can then simply use this text to embed the image in your HTML content. A PHP example is available here: Base64 Encoding Image

Community
  • 1
  • 1
jitendra
  • 1,438
  • 2
  • 19
  • 40