1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

[SCRIPT] Changing md5 is not enough, do this instead

Discussion in 'Scripting' started by Better Know, Apr 16, 2019 at 8:12 AM.

  1. Better Know

    Better Know Jr. VIP Jr. VIP

    Joined:
    Mar 17, 2018
    Messages:
    258
    Likes Received:
    230
    Home Page:
    With modern day algorithms' ability to detect duplicate images with machine vision without the need to use any hashing it became easy to detect reposting.

    The script below will change the image by adding a few effects that'll make it almost unrecognizable to machines but not change it much for the human eye, simply follow the instructions:

    1) Download ffmpeg from here: https://ffmpeg.zeranoe.com/builds/

    2) Extract the file ffmpeg.exe to "C:\Program Files\ffmpeg\ffmpeg.exe"

    3) In the same folder create a new .txt file and rename it to "edit.bat" (remove the .txt)

    4) Open the new edit.bat file and copy the script below to it:

    Code:
    ::Replace png with whatever file format you have. (mp4, ts, jpg, etc.)
    set FileFormat=png
    
    ::Directory where you have your unedited files. (Make sure you end it with a "\")
    set UneditFilesDirectory=C:\Program Files\ffmpeg\png\
    
    ::Directory where you want your edited files to be saved (Make sure you end it with a "\")
    set EditedFilesDirectory=C:\Program Files\ffmpeg\png2\
    
    for %%d in ("%UneditFilesDirectory%*.%FileFormat%") do "C:\Program Files\ffmpeg\ffmpeg.exe" -i "%%d"  -map_metadata -1 -vf "eq=brightness=0.06:saturation=1.1:contrast=1.4,lenscorrection=k1=-0.02:k2=0.01" "%EditedFilesDirectory%%%~nd.%FileFormat%"
    
    Replace "png", "C:\Program Files\ffmpeg\png\" and "C:\Program Files\ffmpeg\png2\" with your correlating values.

    You can use the script for images or videos, each has to be done individually.

    This will remove all metadata, change colors a little and distort shapes and objects in a way where it's harder for machine vision to detect.

    This might not work properly if your image or video contains any subtitles or similar small text as it will distort the lines and letters.

    You can also do something similar to watermark videos, let me know if you're interested in seeing that.
     
    • Thanks Thanks x 10
  2. fostdecile

    fostdecile Regular Member

    Joined:
    Dec 25, 2014
    Messages:
    250
    Likes Received:
    116
    Occupation:
    Just a salesman
    Location:
    Balamb Garden
    Thank you @Better Know, very cool!

    This could be the reason why some of my accounts got banned even after changing the hash, gonna try it soon after all my accounts are banned! (weird goal, I know)
     
  3. Zidy

    Zidy Registered Member

    Joined:
    Aug 9, 2017
    Messages:
    83
    Likes Received:
    21
    Gender:
    Male
    Great share.

    Thanks for this :)
     
  4. Better Know

    Better Know Jr. VIP Jr. VIP

    Joined:
    Mar 17, 2018
    Messages:
    258
    Likes Received:
    230
    Home Page:
    Yeah, it's possible that was the cause.
     
    • Thanks Thanks x 1
  5. Better Know

    Better Know Jr. VIP Jr. VIP

    Joined:
    Mar 17, 2018
    Messages:
    258
    Likes Received:
    230
    Home Page:
    Bumping this so more members get to see it.
     
  6. amateurhunter

    amateurhunter Registered Member

    Joined:
    Aug 16, 2018
    Messages:
    63
    Likes Received:
    12
    Gender:
    Male
    Would anyone be interested in a website that does this? I can probably create one where you upload it and it spits out the "new" image.
     
  7. Tillymanjaro

    Tillymanjaro Registered Member

    Joined:
    Jan 25, 2019
    Messages:
    55
    Likes Received:
    22
    Gender:
    Male
    Sounds interesting to me. Actually have been looking for a service like that a while ago.
     
  8. mbfootball47

    mbfootball47 Newbie

    Joined:
    Apr 1, 2010
    Messages:
    38
    Likes Received:
    5
    Great share. I was wondering if IG could still detect duplicate images even after changing the hash
     
  9. GoGuerilla

    GoGuerilla Jr. VIP Jr. VIP

    Joined:
    Oct 15, 2018
    Messages:
    194
    Likes Received:
    73
    ffmpeg is a livesaver and an amazing tool. Great share, thanks.
     
  10. Frenzied

    Frenzied Jr. VIP Jr. VIP

    Joined:
    Feb 16, 2016
    Messages:
    340
    Likes Received:
    258
    Awesome, might add this to my account creator :)
     
  11. Better Know

    Better Know Jr. VIP Jr. VIP

    Joined:
    Mar 17, 2018
    Messages:
    258
    Likes Received:
    230
    Home Page:
    I can imagine something like this being useful to members here
     
  12. Zangzing

    Zangzing Registered Member

    Joined:
    Jan 18, 2019
    Messages:
    53
    Likes Received:
    11
    Thanks for this one
     
  13. hustleup

    hustleup Regular Member

    Joined:
    Apr 18, 2010
    Messages:
    283
    Likes Received:
    40
    was looking for somehtining like this thanks man
     
  14. majdi107

    majdi107 Jr. VIP Jr. VIP

    Joined:
    Aug 28, 2014
    Messages:
    1,792
    Likes Received:
    326
    Occupation:
    BHW
    Location:
    BHW
    Home Page:
    Can i use this to make youtube video unique ?
     
  15. Better Know

    Better Know Jr. VIP Jr. VIP

    Joined:
    Mar 17, 2018
    Messages:
    258
    Likes Received:
    230
    Home Page:
    I haven't tested it myself, but I think the YT algorithm is much more advanced than that of IG. Maybe try it and let us know.
     
  16. Kelvinyung

    Kelvinyung Junior Member

    Joined:
    Feb 24, 2018
    Messages:
    141
    Likes Received:
    34
    Gender:
    Male
    Thanks for the share. Do you think it good for Pinterest?
     
  17. Better Know

    Better Know Jr. VIP Jr. VIP

    Joined:
    Mar 17, 2018
    Messages:
    258
    Likes Received:
    230
    Home Page:
    I don't see why it wouldn't.

    This would depend on what type MV algorithm they're using. Most simple algorithms won't be able to detect it, however advanced ones might be able to, especially if the image has a lot of shapes or objects where the filters could be detected.
     
  18. WhereIsMyMoney

    WhereIsMyMoney Newbie

    Joined:
    Apr 7, 2016
    Messages:
    33
    Likes Received:
    13
    I think no one uses cryptographic hash like md5 to check if media is similar anymore. Maybe they do, but it's not the only thing they use. Even without machine learning, you can use algorithms like perceptual hash which is easy to implement to check if two images are the same or not. In this, cases adding some random pixels to change md5 wouldn't even matter.

    Haven't tested how good your method @Better Know works, but thanks for sharing.