4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: thr0ne on September 02, 2002, 03:29:11 PM

Title: Pic Security
Post by: thr0ne on September 02, 2002, 03:29:11 PM
Quote
leider nützt das Skript das die Bilder vor dem unbefugten speichern Schützen sollte nicht viel. Wie bei meisten dieser Skripts gibts hier einen einfachen Trick:

- Rechte Maustaste gedrückt halten
- Dialog (Copyright....) mit Return schließen
- anschließend die rechte Maustaste wieder loslassen.

=> Schwupp das Context-Menü ist da  

Gibts keine Abhilfe? Wer hat ne Idee das besser zu schützen?


Ich sichere nur kleine Firmennetzwerke keine Bilder :) trotzdem hab ich eine Methode:



1. Verzeichnis schützen

Schützen sie Ihr Verzeichnis mit einer .htaccess Datei.
(leere Datei oder Errordokumentangabe)


2. Grafik anzeigen

Das Script zum Anzeigen der Grafik zeigt das Bild mit
Hilfe einer Tabelle an. Der Trick: Das eigentliche Bild wird als
Hintergrundbild eingebaut, als Inhalt für die Tabellenzelle verwenden
wir ein transparentes Gif. Somit ist das Abspeichern der Grafik
per Rechts-Klick auch unterbunden.

Der Trick in Html:
Code: [Select]

<table CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="100" HEIGHT="100">
<tr><td BACKGROUND="ihrbild.gif">
<img SRC="transparent.gif" height=100 width=100>
</td></tr></table>

Dieses Wissen verwenden wir nun in den PHP Dateien:

Quellcode "view_image.php":
Code: [Select]

<?php 

session_start
(); 

// Cache deaktivieren 
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
header("Last-Modified: " gmdate("D, d M Y H:i:s") ." GMT"); 
header("Pragma: no-cache"); 
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate"); 

// Challenge-ID 
mt_srand((double)microtime()*1000000); 

$random mt_rand(); 
$random md5(uniqid($random,TRUE)); 

$sess_challenge_id $random

if(!
session_is_registered("sess_challenge_id")): 
  
session_register("sess_challenge_id"); 
endif; 

// Grafik auslesen 
$pic    "tolle-grafik.jpg"
$img    = @GetImageSize("/absoluter/pfad/zu/verzeichniss/images/".$pic); 
$width  $img[0]; 
$height $img[1]; 

// HTML-Tabelle anzeigen 
printf("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%s\" height=\"%s\">\n",$width,$height); 
print 
"<tr>\n"
printf("<td width=\"%s\" height=\"%s\" background=\"read_image.php?img=%s&challenge=%s\">",$width,$height,rawurlencode($pic),$sess_challenge_id); 
printf("<img border=\"0\" src=\"blind.gif\" width=\"%s\" height=\"%s\">",$width,$height); 
print 
"</td>\n"
print 
"</tr>\n"
print 
"</table>\n"

?>


Erklärung:
Als allererstes müssen Sie eine Session starten.
Danach deaktivieren Sie sicherheitshalber noch den
Cache und erzeugen eine 32 Zeichen lange "Challenge-ID".
Solche Challenge-ID's kann man übrigens auch gut verwenden,
um beispielsweise Reloads zu erkennen.
Diese Challenge-ID registrieren wir als Session-Variable.
Nun müssen Sie nur noch mit GetImageSize()
die Grösse der Grafik auslesen.

Nun kommt der eigentliche Trick:
Anstatt die Grafik direkt einzusetzen,
starten wir dagegen ein zweites Script
"read_image.php" und hängen als GET-Parameter
den Namen der Grafik-Datei und unsere
Challenge-ID hinten dran.

3. Grafik auslesen:

Nun benötigen Sie ein zweites Script, um Ihre
Grafik aus dem geschützten Verzeichnis auszulesen.
Der Quellcode dazu sieht folgendermaßen aus:
Code: [Select]

<?php 

session_start
(); 

// Challenge-ID OK -> Bild anzeigen 
if(session_is_registered("sess_challenge_id") and $sess_challenge_id == $challenge): 

  
session_unregister("sess_challenge_id"); 

  
$path "/asoluter/pfad/zu/verzeichniss/images/"
  
$img  rawurldecode($img); 
  
$read = @GetImageSize($path.$img); 
  
$type $read[2]; 

  
// Nun bestimmen wir den Datei-Typ, damit wir dem Browser sagen können 
  // welcher Grafik-Typ er nun vorgeschmissen bekommt 
  
switch($type
    { 
    case 
1
      
$mime "image/gif"
    break; 
    case 
2
      
$mime "image/jpeg"
    break; 
    case 
3
      
$mime "image/png"
    break; 
    case 
4
      
$mime "application/x-shockwave-flash"
    break; 
    } 

  
// Nun senden wir die Header und lesen mit readfile() unsere 
  // Grafik aus und senden diese direkt an den Browser 
  
header("Content-Type: $mime"); 
  
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
  
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); 
  
header("Pragma: no-cache"); 
  
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate"); 
  
readfile($path.$img); 

// Unerlaubter Zugriff -> Transparentes GIF *ätsch* 
else: 
  
header("Content-type: image/gif"); 
  
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
  
header("Last-Modified: " gmdate("D, d M Y H:i:s") ." GMT"); 
  
header("Pragma: no-cache"); 
  
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate"); 
  
readfile("blind.gif"); 
endif; 

?>


Als erstes überprüfen Sie, ob Ihre Session-Variable
registriert wurde und wenn ja, ob diese mit der übermittelten
Variable "challenge" übereinstimmt. Ist dies der Fall,
befreien Sie zuerst Ihre Session-Variable,
damit man die URL nicht per Copy & Paste aus dem
Quelltext in den Browser übernehmen kann.
Danach bestimmen Sie wieder mit GetImageSize() den
Grafiktyp, damit Sie dem Browser die richtigen Header übermitteln können.
Nun müssen Sie nur noch die Grafik per readfile() direkt an den Browser senden.

Falls jedoch keine Session-Variable registriert wurde bzw.
die beiden Challenge-ID's nicht übereinstimmen,
wird lediglich ein transparentes Gif ausgelesen und angezeigt.

Fassen wir das Ganze noch einmal zusammen und sehen uns an,
auf welche Arten unsere Grafik geschützt wurde:

Verzeichnisschutz per .htaccess
-> kein Zugriff per Browser
Grafik als Tabellen-Hintergrund mit transparentem Gif als Inhalt
-> beim Speichern wird nur das transparente GIF abgespeichert
Session-Variable wurde nicht registriert bzw. Challenge-ID's stimmen nicht überein
-> transparentes Gif wird angezeigt

Somit sind die Bilder vor so gut wie allen bekannten Zugriffs-
methoden sicher.


Ach ja - Jan - falls du das liest, ich würde niemals verlangen das du sowas ganz einbindest, aber den HTML-Trick von 2., wie würde man den
am besten in 4images umsetzen?

greets, phil
Title: Pic Security
Post by: Jan on September 02, 2002, 03:56:37 PM
Spar Dir am besten das rumgefummel, Bilder lassen sich nicht schützen. Trotz aller Anstrengungen kann man am Ende einfach einen Screenshot machen und schon hat man das Bild.

Jan
Title: Looks very interesting
Post by: Chris on September 02, 2002, 10:18:50 PM
thr0ne:

Any chance you could repost this in english?

By the way, I've also seen javascript that triggers a history.back() if the onBlur event happens.  That way if the user presses any key to take a screen shot, or switches windows, the picture can't be grabbed.
Title: Pic Security
Post by: bernd on September 03, 2002, 12:59:40 AM
Quote from: Jan
Spar Dir am besten das rumgefummel, Bilder lassen sich nicht schützen. Trotz aller Anstrengungen kann man am Ende einfach einen Screenshot machen und schon hat man das Bild.


Trägt nicht zum Thema bei aber trotzdem: genau meine Meinung

cheers,
Bernd[/b]
Title: Pic Security
Post by: thr0ne on September 03, 2002, 02:02:06 PM
ja kommt, ausser meinen beitrag runterzumachen kommen hier keine kommentare?

ich finde dieser vorgang hat vorteile:
- kein besucher kann ein ganzes verz. voller bilder
  ziehen/ drauf zugreifen

- die lästige rechtsclicksperre ist nicht mehr unbedingt
  nötig

- kein besucher wird sich die mühe machen 100+ Bilder
  per Screenshot zu zocken, während die oben genannte
  Methode mit der Javascriptüberbrückung recht einfach ist.

ok...Chris , i ll try to send this in short summary to your email soon
Title: Pic Security
Post by: Jan on September 03, 2002, 03:34:37 PM
Quote
ja kommt, ausser meinen beitrag runterzumachen kommen hier keine kommentare?

Es war nicht meine Absicht Deinen Beitrag runterzumachen. Sorry, wenn es so rübergekommen ist.

Quote
- kein besucher kann ein ganzes verz. voller bilder ziehen/ drauf zugreifen

Das sollte bei einem richtig konfigurierten Server sowieso nicht möglich sein.

Quote
- die lästige rechtsclicksperre ist nicht mehr unbedingt nötig

Das war vor einiger Zeit ein Wunsch mehrerer User und nie wirklich als Schutz gedacht.

Quote
- kein besucher wird sich die mühe machen 100+ Bilder
  per Screenshot zu zocken, während die oben genannte
  Methode mit der Javascriptüberbrückung recht einfach ist.

Die meisten möchtes ja sowieso nur 1 oder 2 Bilder haben. Die Leute die wirklich alle Bilder ziehen wollen, schaffen es dann auch trotzdem.

Kennst Du diesen Beitrag schon: http://www.4homepages.de/forum/viewtopic.php?p=4769#4769

Gruß Jan
Title: Pic Security
Post by: bernd on September 03, 2002, 08:45:00 PM
Quote from: thr0ne
ja kommt, ausser meinen beitrag runterzumachen kommen hier keine kommentare?


Sorry thr0ne - auch nicht meine Absicht. Technisch sehr interessant und ausgebufft; ich würd's nicht hinbekommen (zum Glück muß ich's auch nicht). Aber wie Jan denke ich auch, daß es den Aufwand nicht wert ist - wer die Bilder haben will, der kriegt sie auch - so ist das leider.

Just my 0.02€
cheers,
Bernd
Title: Pic Security
Post by: JMS on September 10, 2002, 03:21:50 PM
Quote from: bernd
Technisch sehr interessant und ausgebufft


... klingt irgendwie untertrieben. Ich habe mir gestern 'nen Wolf getippt, selber was gestrickt aber richtig funktioniert hat's erst nicht. Ich werd's mal mit dem Scrpit ausprobieren!

Gruss

JMS
Title: Pic Security
Post by: Nossie on September 14, 2002, 12:44:50 PM
or you could just retrieve the images from the cache no ? :P
Title: Perhaps not
Post by: Chris on September 29, 2002, 06:06:14 PM
Quote
or you could just retrieve the images from the cache no ?


Code: [Select]
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
Title: English translation of the posted method
Post by: Chris on September 29, 2002, 06:18:25 PM
For everyone's benefit in this forum, here is the english translation I received from thr0ne.  Sorry it's so late, I received it very shortly after asking for it, I just didn't think of posting it here until now.

Quote

1. Secure your Directory

Secure it with a .htaccess file in it.
(empty file)


2. View the Pic

The viewscript shows the Picture in a table.
the trick: the real pic is the background, the
content a transparent .gif. there is no way to
rightclick the background.



in Html:
Code:

<table CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="100" HEIGHT="100">
<tr><td BACKGROUND="ihrbild.gif">
<img SRC="transparent.gif" height=100 width=100>
</td></tr></table>
 

Our Knowledge in the PHP Files:

Sourcecode "view_image.php":
Code:

<?php

session_start();

// deactivate cache
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") ." GMT");
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");

// Challenge-ID
mt_srand((double)microtime()*1000000);

$random = mt_rand();
$random = md5(uniqid($random,TRUE));

$sess_challenge_id = $random;

if(!session_is_registered("sess_challenge_id")):
  session_register("sess_challenge_id");
endif;

// Read image
$pic    = "tolle-grafik.jpg";
$img    = @GetImageSize("/absoluter/pfad/zu/verzeichniss/images/".$pic);
$width  = $img[0];
$height = $img[1];

// show HTML table
printf("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%s\" height=\"%s\">\n",$width,$height);
print "<tr>\n";
printf("<td width=\"%s\" height=\"%s\" background=\"read_image.php?img=%s&challenge=%s\">",$width,$height,rawurlencode($pic),$sess_challenge_id);
printf("<img border=\"0\" src=\"blind.gif\" width=\"%s\" height=\"%s\">",$width,$height);
print "</td>\n";
print "</tr>\n";
print "</table>\n";

?>
 

Description:
You have to start a session first.
After this, we deaktivate the Cache because of
security reasons and build a 32 chars long "challenge-id"
these challenge ids can be also used to notice reload.
now just read the image size with GetImageSize()

Now the real trick:
Instead of pointing to the image
directly, we start another Script,
"read_image.php" and attach as Get-Parameter
the Name of the Image-File and our
Challenge-ID.


3. Reading the Image

We need another Script, for reading
the Image out of the secured dir.
The Sourcecode:

<?php

session_start();

// Challenge-ID OK -> Show Pic
if(session_is_registered("sess_challenge_id") and $sess_challenge_id == $challenge):

  session_unregister("sess_challenge_id");

  $path = "/asoluter/pfad/zu/verzeichniss/images/";
  $img  = rawurldecode($img);
  $read = @GetImageSize($path.$img);
  $type = $read[2];

  // Set kind of File

  switch($type)
    {
    case 1:
      $mime = "image/gif";
    break;
    case 2:
      $mime = "image/jpeg";
    break;
    case 3:
      $mime = "image/png";
    break;
    case 4:
      $mime = "application/x-shockwave-flash";
    break;
    }

  // Send Header and read the image with readfile()  
  // sending the graphic to the browser
  header("Content-Type: $mime");
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
  header("Pragma: no-cache");
  header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
  readfile($path.$img);

// Access denied -> Transparent GIF *doh*
else:
  header("Content-type: image/gif");
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  header("Last-Modified: " . gmdate("D, d M Y H:i:s") ." GMT");
  header("Pragma: no-cache");
  header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
  readfile("blind.gif");
endif;

?>
 
At first we test the Session-Value and compare it
with the challenge. if its ok, we delete the session
variable to prevent copy and paste out of the
page-source.
now getimagesize() again, to give the browser
the right header.
readfile() the image to the browser.

if there's no session-variable or the challenger-IDs
don't match, there will be only a transparent .gif.

Summary of security methods:

Directory secured with .htaccess
No Access with browser
Graphic as Table-Background
Transparent Gif
Session Variables and Challenge IDs
Title: You know its hilarious....
Post by: Nossie on September 30, 2002, 06:23:53 PM
to think that you could slow the php process right  down.. disabling this... disabling that...

and then someone comes along, takes a screendump and pastes it into photoshop...

why bother?
Title: It's encouraging
Post by: Chris on September 30, 2002, 08:38:12 PM
At least this thread is encouraging some thought and discussion on the topic.  My guess is the solution provided here would work for what has to be an overwhelming majority of web visitors.  You're right in that the user could still try to capture the screen.

Now if you *really* wanted to discourage screen shots, you could try using javascript's onblur event to trigger a history.back or window.close or image swap or something else for when the window loses focus.  Additional javascript code could detect when keys are hit and take the same possible set of actions.

Personally I use a watermark on all my images just to be extra safe.
Title: Pic Security
Post by: Nossie on September 30, 2002, 08:54:03 PM
heh sorry I didnt mean to be negative......

yeah it is good to come up with ideas etc

I just always think that crippling performace to improve security is something that microsoft would do  :lol: especially when it can be evaded by using print screen... of some other form of screen capture that doesnt use keypresses (or product keys)

ahh well...

I agree with you Chris... watermarks (no matter how ugly they might look) are probaly the best way to keep your files safe..
Title: Implementation help needed
Post by: Chris on October 07, 2002, 04:51:45 AM
Well I tried this code and on its own it works nicely.  I couldn't get it to work with the default 4images details.html template.

Even so, using the script on its own I was able to get the image by saving the HTML page using IE 6 File>Save As...
Title: Pic Security
Post by: Chris on February 18, 2003, 05:30:48 PM
Quote from: Nossie
especially when it can be evaded by using print screen... of some other form of screen capture that doesnt use keypresses (or product keys)

If the visitor is using IE 5.x or higher, there is a solution to the dreaded screen print.  Open the details.html template and add this to the top:
Code: [Select]
{header}

<script language="JavaScript" type="text/JavaScript">
  window.setInterval("window.clipboardData.setData('Text','[The clipboard is temporarily disabled. To restore normal function, simply close the web browser currently viewing a full size image at {site_name}]')",20);
</script>

This code sets the clipboard data to the text message "clipboard is temporarily disabled" every 20 milliseconds.  This will also block the capture function of any software that uses the system clipboard which is all of them in my experience.

I've tested this under MS Windows, not sure about Macintosh.  I'd estimate 85% of my visitors are using MS Windows and IE 5.x or higher so this is a fairly effective javascript.

According to http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/clipboarddata.asp the following code is supposed to clear the clipboard of any image data.  This allows the user to retain the ability to copy and paste text, URL, file and HTML data.
Code: [Select]
window.setInterval('window.clipboardData.clearData("Image")',20);
At one time a couple days ago, I had this working.  The user couldn't screen capture to the clipboard but could still cut and paste text.  Since then I haven't gotten it to work.  the clearData('Image') method just clears all data.  Not sure what I'm doing wrong and it's probably something to do with my other javascripts.  In any case I present it here for everyone's benefit.

Just thought I'd share what I've learned recently.
Title: Pic Security
Post by: Nossie on February 18, 2003, 05:42:08 PM
one thing though Chris...

I like that idea, but I know alot of programs that can prevent javascript from operating.

So that would be MY way around that  :)
Title: Pic Security
Post by: Chris on February 19, 2003, 12:59:12 AM
Hey I'm not saying we can totally and completely prevent images from getting snagged.  That's an impossible task given the nature of the http(s) protocol.  I should know since I make my living as a computer programmer and software architect.  In fact all you'd have to do is use a browser other than IE which is what I stated; one like Mozilla, Netscape or Opera.  I can also think of a dozen other techniques and software that would accomplish the same thing.  

But given that 85-90% of my visitors are using a browser in which this will work and that maybe 0.5% might be technically minded, I think it's worth implementing for my site.  I also display the details page in a browser with no chrome (toolbars, menus, access to bookmarklets, etc) so you'd have to use a 3rd party tool to see the source code to figure out it was a javascript that was doing this.

I'm just sharing little things people can do to discourage image theft.  It's been said, and rightfully so, that locks only keep out honest people.  A thief will always steal what they want.  :wink:
Title: Pic Security
Post by: Nossie on February 19, 2003, 01:05:23 AM
Quote
Hey I'm not saying we can totally and completely prevent images from getting snagged.


why do I get a feeling of dejavu (even if I cant spell it lol)?

I never meant that comment in bad way... sorry...

nother nice way to stop the not so techie minded from theivin images :)
Title: Pic Security
Post by: Chris on February 19, 2003, 01:49:18 AM
Quote from: Nossie
I never meant that comment in bad way... sorry...

No problem.   :lol:  

Here's another:

Use javascript to decrypt a PHP encrypted image link and document.write it to the page.  Use the <noscript> tag to point to a web site logo.  If the user disables javascript, they only get to see the logo and not the image they wanted.  Effective for me since I use a chromeless window for the images.

This stops the user from disabling javascript.  

Perhaps more importantly, it also stops web site copiers and offline browsers like Wget, WinHTTrack, Teleport Pro, etc.   :twisted:
Title: Pic Security
Post by: Nossie on February 19, 2003, 06:23:52 AM
a bit similar to hotlink protection?

last time I enabled that on the server... half the images turned into "you've theived this from...." hehe

I have to admit the only thing that bothers me personaly is bandwidth theft so this doesnt apply to me too much

nice thinking going on there tho :)

(\).
Title: Won't stop hotlinks
Post by: Chris on February 19, 2003, 06:49:52 PM
For the uninitiated:  Hotlink protection is when you implement measures to ensure the link was followed from your site.

The technique I've described only ensures the user has javascript enabled and that web site copiers can't grab the images.  It's not actually a hotlink issue since the pages and image links are being loaded from the 4images site itself either from the user's javascript enabled browser or from web site copying software.  

For those reading who don't know about hotlinks, a hotlink is when a web page on someone else's web site links to images on your web site.  This steals your bandwidth by loading your images in their pages by reading them off your server.  

What I documented wouldn't stop that from happening.  Another post already exists in these forums that describes a method for preventing hotlinks by using the .htaccess file for Apache web servers.  Another approach is to use PHP to set and check a session variable before allowing the user to view the file.  That method is covered pretty well by this short article here:
http://www.pinkgoblin.com/bandwidthprotection.php

The main reason I'm taking these steps is to ensure images are only downloaded by registered users and that people can't grab thousands of my photos with a single click of the mouse.
Title: Pic Security
Post by: SLL on February 22, 2003, 04:55:07 PM
Quote from: Nossie
I like that idea, but I know alot of programs that can prevent javascript from operating.

as a very rude measure it's possible to include small javascript, checking if java scripting is enabled, which will redirect you to some empty page with message like "you have to enable scripting to access this gallery". as far as i know, there's no way to disable scripting when page is already loaded.
Title: Pic Security
Post by: Chris on February 22, 2003, 05:03:00 PM
Oh my curiosity is piqued now!

How can a javascript check if javascript has been disabled if javascript has been disabled?  My understanding is that if javascript is disabled in the browser, no javascript script will run.

Is this something that's done using PHP?  I know you can redirect the user from PHP with just:
Code: [Select]
Header( "Location: http://www.Domain.com/" );
I am sincerely curious.  Can you point me to the script?  If it can be done, I'd like to see how.
Title: Pic Security
Post by: Chris on February 22, 2003, 05:16:09 PM
Follow Up:

I only know that you can use the <noscript> tag which is used if javascript is disabled.  Here's an example from the templates media/jpg.html file:
Code: [Select]
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" width="100%">

<script language="JavaScript" type="text/JavaScript">
            document.write('<img src=\"{media_src}\">');
</script>

<noscript>
            <img src="/resources/images/logo.gif"/>
</noscript>

</td>
  </tr>
</table>
Title: Pic Security
Post by: SLL on February 22, 2003, 05:17:59 PM
not to use this way, of course, just an example  :)
Code: [Select]
<script language="javascript" type="text/javascript">
document.write ('blah-blah');
</script>
<noscript>
enable scripting!
</noscript>
Title: Pic Security
Post by: Chris on February 22, 2003, 05:21:52 PM
Ah, just a minute apart between our posts.

When you said "redirect the user to a page" I thought it was something like:
Code: [Select]
location.href="http://www.domain.com/EnableScripting.html"
Okay, I think we are in sync here.  Thanks.
Title: Pic Security
Post by: SLL on February 22, 2003, 05:39:53 PM
as i see, you already had the solution :)

just checked this scripted image output in 4images details.html, it works just fine, so using this way together with other methods mentioned in this thread (disabling cache, etc.) are protection enough, don't you think so?
Title: Pic Security
Post by: SLL on February 22, 2003, 05:48:10 PM
it seems that php is also able to determine if scripting is enabled. http://www.php.net/manual/en/function.get-browser.php

see
Quote
<b>javascript:</b> 1<br />
<b>javaapplets:</b> 1<br />
in the example there
Title: Pic Security
Post by: Chris on February 22, 2003, 06:19:25 PM
Quote from: SLL
so using this way together with other methods mentioned in this thread (disabling cache, etc.) are protection enough, don't you think so?

It's always a tradeoff.   :wink:

I also encrypt the {media_src} link in PHP on the server, use javascript on the client to decrypt the link and document.write() it to the table background.  For the <td> itself I use a transparent gif or a logo gif depending on whether or not the user has javascript enabled.  This is really just to stop web site copiers.

I also employ a couple other things I haven't detailed here but yeah, for the most part it's enough protection (for me)

Perhaps someday I'll find the time to put together all the tips and tricks I use for image protection in one comprehensive tutorial.  It would be a long post for sure!
Title: Pic Security
Post by: jengwen on March 15, 2003, 02:57:00 AM
Do I put this in my details.html?

Quote
<table CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="100" HEIGHT="100">
<tr><td BACKGROUND="ihrbild.gif">
<img SRC="transparent.gif" height=100 width=100>
</td></tr></table>


Also, where does view_image.php get called from?

Could anyone claify the instructions for installingr the scripts a little more?
Title: Pic Security
Post by: Chris on March 15, 2003, 03:25:34 AM
Almost.  You put this in your MEDIA template, not details.html

So if you are displaying a jpg file, this goes in templates/default/media/jpg.html
Code: [Select]
<table width="{width}" height="{height}" border="0" cellspacing="0" cellpadding="0" background="{media_src}">
<tr>
<td width="100%"><img src="{template_url}/images/spacer.gif" width="{width}" height="{height}" /></td>
</tr>
</table>


view_image.php is just a theoretical discussion at this point.  I don't know that anyone has written it yet.
Title: What code ??
Post by: IsaGaming on April 06, 2003, 05:50:37 PM
What code is for that i want:

Check if browser have jaascript if disabled then they will see the image on ( screenshot one ) as blank.gif ( with test on it will say please "enable javascript to enable to see the screenshot") if enabled they will see normaly the screenshots. and disable capture funtion from keyboard or any program,,,
and hotlinking.. if they click on view/source on toolbar on IE or else they will see the link wish have that hidden the link

If there a code please post full code of thoses and in what file where etc pls i am new a little about javascript..
i am good on html and a little to php i started to understand a little on php coding... not javascript i am novice on it :)

( sorry my english i am still learning and i used french :) )

Hope to get a code for my site :)
Thanks!
Title: Pic Security
Post by: Jabo on April 11, 2003, 07:54:11 PM
Hi,

I am very much interested in this security implementation, but I dont know much programming. Can someone please post me the full html code of an HTML file (ie. jpg.html) so I can see how the mods is implemented exactly.

Also, I saw on the first page, a very long PHP code of view_image.php -  do I just make that into a PHP file and upload it?

thanks in advance
Title: Re: Pic Security
Post by: michi-w. on April 23, 2005, 01:26:35 PM
Ich suche keinen Kopierschutz, sondern einen Löschschutz, der verhindert, das Bilder versehentlich vom Admin gelöscht werden.

Stell mir das so vor:
Standardeinstellung, wie gehabt.
Sicherheitseinstellung, kann für jeden Upload im ACP erstellt werden, die ID eines Uploads wird in eine extra Tabelle in die Datenbank o.ä. eingetragen, diese Uploads können nicht gelöscht werden, es ist also keine Grundeinstellung, sondern eine zusätzliche Funktion in "Bilder bearbeiten".
Bei einem Löschversuch, erscheint folgende Meldung:
"Upload befindet sich im Schutzbereich, tragen sie die ID aus, um den Upload zu löschen."

Das ganze wird nur über das ACP gesteuert, der User hat keine Möglichkeit, den Schutz zu beeinflussen. Falls er versucht, seinen geschützen Upload zu löschen, erscheint die Meldung:
"Upload befindet sich im Schutzbereich, wenden Sie sich an den Administrator, um den Upload zu löschen".

Wäre das machbar?

Gruß
michi-w.

P.S. falls sich jemand findet, der Englisch kann, habe ich nichts gegen eine Übersetzung meiner Frage! :wink:
Title: Re: Pic Security
Post by: Chicco on March 03, 2006, 02:35:24 PM
Also bei mir bringt das mit der .htaccess datei absolut nichts.

Beispiel:
Es liegt in meinem DATA/MEDIA-Ordner in der Kategorie 20 ein Bild drin und ich kenne diesen Namen vom Bild durch meinen Quelltext anhands des Thumbnails, dann ist es möglich dieses Bild direkt im browser aufzurufen per www.MEINESEITE.DE/DATA/MEDIA/20/test.jpg.

Sowas dürfte aber nicht sein! Und wnen ich nun eine leere .htaccess-datei in das verzeichnis 20 lege, kann man trotzdem das Bild laden!

Ich habe z.b. eine Kategorie, auf die nur Registrierte User Zugriff haben und Gäste die Thumbnails nur verschwommen ansehen. Schaut nu ein Gast sich mal den Quelltext an und sieht wie so manches Thumbnails heisst, kann es über den Browser direkt auf dieses Bild zugreifen im data/media/-Verzeichnis. Versteht ihr wie ich es meine????
Title: Re: Pic Security
Post by: IcEcReaM on March 03, 2006, 06:17:15 PM
htaccess bringt nur was, wenn alles richtig eingetragen ist in der Datei,
und der Server auch ModRewrite unterstützt.

Ansonsten kannst du ja einfach den MEDIA Ordner umbennen,
und entsprechend das in der constants.php ändern.

Wenn du entsprechende Mods von der ersten Seite drin hast,
ist es schwierig den Download Ordner rauszufinden.
Title: Re: Pic Security
Post by: V@no on March 04, 2006, 12:47:15 AM
omg...I thought this topic was lost, that why a new topic (http://www.4homepages.de/forum/index.php?topic=6997.0) with references to reply from this topic was created...
Should I lock up this topic with link to the new one, cause there we have more recent discussions...? cause it might bring a confusion....