Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have encrypted the src path of an img tag..example: ftp address/ids/jer.jpg in encrypted form.how to display image using this encrypted path using javascript only.please help me to do this..I have tried with backgroud image solution&disable right click option.


<img src=""id="i">
encrypt();
decrypt();
function encrypt(){
//any encryption method
img.src=encrypted path;
}
function decrypt(){
//any decryption method
document.queryselector("div").style.backgroundImage=decrypted path;
}

This works...but i need to display image with that encrypted path itself.Is there any solution other than this??The browser will not show the image through the encrypted path in javascript,anyway we have decrypt the path but how to hide the src path of an image when view source is given..please help me..
Posted

1 solution

 
Share this answer
 
Comments
Member 11282742 5-Dec-14 1:04am    
It should be done using javascript only,no other tags should be used..
Member 11282742 5-Dec-14 1:06am    
How to secure img src path using javascript when the user clicks on view source.
ZurdoDev 5-Dec-14 7:31am    
If a user clicks view source, they'll see the source. There is no way around that.
Member 11282742 5-Dec-14 11:15am    
how to avoid this,is my problem.
ZurdoDev 5-Dec-14 11:25am    
You can't. The problem is the browser runs on the client computer so the image has to be accessible from their machine. That is how html works. So, you can't hide the url. The best you can do is the link above using an image handler to help hide it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900