Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: [GD Lib] Create Watermark

  1. #11
    Join Date
    Feb 2009
    Posts
    73
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    sorry, what I meant is like this :

    I have a folder and it's file like this :

    Images
    l- file1.jpg
    l- file2.jpg
    l- file3.jpg

    ----------------------------------------
    what I wanna do is create a watermark on each of the files in Images Folder, which text is according to it's file name.

  2. #12
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You can use the functions opendir() and readdir() to run through all of the files in a certain folder, and the filename will be accessible in that process.

    Dirt_diver, there are libraries for md5 available, but that is not the same as being breakable. Those libraries are based on pairs-- they encrypt input and look at the md5 output, then when you search the library it does the opposite-- it's generating all of it's results, and it cannot actually reverse the process, just mirror it and show you if it knows what the original input was. The algorithm is still secure, but it's output may, by brute force, be eventually cracked. Obviously a shorter/more common password will be less secure for this reason. Because of this, it is possible that md5 is becoming weak for passwords on websites (though it's still very common, just don't use something that's in the libraries-- make it random, not just not a dictionary word, but just something no one else would think of-- put two things together that don't belong together), but this will have no effect whatsoever on images, because none of those libraries can possibly actually contain images-- if it does have a match for the md5 string it decrypts, then it will be a password that happens to coincide with the md5 string of the image, but it is more likely that nothing will happen at all. For this reason, uploading an image/file as a password has been considered by some to be a good solution, aside from the hassle of actually doing that/coding it.
    Plus, in this case, there is no real issue with it at all, as no one will be attempting to decrypt it, most likely, or at least they won't know where the actual image directory is, so it will be worthless to them.

    As a side note, it'll be stronger if the image itself (as a file) is used as the md5 input, rather than just the filename. (Though it'll also be slower, but from what I've seen it's still plenty fast for most purposes, as long as it isn't looped many times, etc.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Tags for this Thread

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
  •