SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    protect html files?

    hi all

    which is the best way to protect html files from being stolen(downloaded)? Or if they are being downloaded which is the best way to encrypt them?
    you see i have some templates in html and css. many customers wants to see them live. but i can't do that for security reasons. i would like to protect the files from being downloaded or in case they still are i would like to protect the content.

  2. #2
    SitePoint Evangelist Karpie's Avatar
    Join Date
    Jul 2007
    Location
    Perth, Australia
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To view them in your browser, you have to download them. What you're suggesting really can't be done.

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    protecting files

    The best way to keep something from being stolen is to not put it online. Other that that, anything thing that is downloaded is on the users machine and capable of being kept.
    Second best, hire a lawyer to take all the legal precautions and be prepared to sue.

    Maybe you could use screen captures of the pages instead of "live" and hope no one copies the text content? Or maybe putting the files in a protected folder would be sufficient safe guard?

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As others have said, it can't be done. By using absolute URIs for everything, you can cause some extra work for content thieves, but that's about it.

    If you discover that your content has been stolen, you can file a lawsuit against the thief, but you can't really prevent the theft as such.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Enthusiast cssiscool's Avatar
    Join Date
    Feb 2006
    Location
    East Moline, Illinois
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    their is only one way to stop theives. keep everything off of the internet.

    newbies are your worst enemy. they do most of the stealing. but since they aren't too tech savvy you can fool them a little by disabling their right mouse button with a javascript.

    even if no person actually took your stuff the web archive bots would. anything that has been on the web longer than 48 hours is in the archive.

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,250
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    yes, there is a way to protect your html source

    right after the <BODY> tag, wrap your entire page contents with the <SECRET> tag --
    Code:
    <html>
    <body>
    <secret>
    normal page contents go here
    </secret>
    </body>
    </html>
    now, no one will be able to steal your content

    of course, if you try to look up the SECRET tag at, say, the W3C site, or in other html tutorials, you won't find it

    that's because it's a secret

    however, rest assured that once you have protected your templates this way, no one will take them

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The <secret> tag is definitely the way to go. It works just as well as any other encryption method for HTML with a much lower overhead and cost. Some of the alternatives can cost hundreds of dollars, make the page source much bigger, stop the page displaying for some visitors and are at best as effective as the <secret> tag in protecting your source.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    True. I've been using the SECRET-tag for years now, and noone has ever stolen my contents.

    You should be aware that IE 5.5 for Mac will allow the user to by-pass the SECRET-tag because of a browser bug. To avoid this, you need to a bit of Javascript:
    Code javascript:
    function nocopy(contents) {
      alert("This document is protected by the SECRET-tag.");
      alert("Thank you for visiting.");
      document.location = "http://www.google.com/";
    }

    Code html4strict:
    <body>
      <secret onload="nocopy(document)">
        <!-- contents go here -->
      </secret>
    </body>
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  9. #9
    SitePoint Wizard bronze trophy Tailslide's Avatar
    Join Date
    Feb 2006
    Location
    Bedford, UK
    Posts
    1,687
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Far far too much time on your hands! (plus obviously you're evil!).
    Little Blue Plane Web Design
    Blood, Sweat & Rust - A Land Rover restoration project

  10. #10
    SitePoint Evangelist Karpie's Avatar
    Join Date
    Jul 2007
    Location
    Perth, Australia
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And they say developers dont have a sense of humour


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •