Hide Secret Messages in PNG Files

Ғылым және технология

In this video, we learn how to hide secret messages inside of PNG files.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/
Timestamps:
(0:00) Intro
(1:12) PNG File Structure
(3:07) Hide Messages Simply
(6:18) Hide Programs Simply
(9:40) Professional Hiding (LSB)
(27:41) Outro

Пікірлер: 48

  • @user-ux8vk8pu2b
    @user-ux8vk8pu2b2 жыл бұрын

    Dude you're amazing. I've been trying to figure out how to do this for a while, thank god someone helped explain it clearly.

  • @chonkey
    @chonkey6 ай бұрын

    i love you. this is exactly what i was looking for. after 3 hours of researching, i found your vid. i just made 30 google accounts and liked and subscribed to your channel.

  • @prof.tahseen6104
    @prof.tahseen61042 жыл бұрын

    13:50 You could actually write the length of the hidden message as the hidden message's first two bytes or so. Also after I saw this video, I literally smashed my mouse and opened up my IDE. I mean, this is an interesting topic. Great video, great channel, great biceps ;)

  • @Sinke_100
    @Sinke_1002 жыл бұрын

    During christmass i was acually doing just that, hiding "Mery Christmass" into picture of a christmass tree, perfect timing neural nine to teach me some better ways to aproach this, ty so much for amazing content 🙂

  • @higiniofuentes2551
    @higiniofuentes2551 Жыл бұрын

    Thank you for this awesome and very useful video!

  • @asphaltexplorer4390
    @asphaltexplorer4390 Жыл бұрын

    Amazing , Thankyou for such a great content sir.

  • @mgreek31
    @mgreek31 Жыл бұрын

    Thank for Great knowledge !!!

  • @AbdoAzmy2005
    @AbdoAzmy20052 жыл бұрын

    can you please tell us about the quantum computing folder

  • @jesusdacoast872
    @jesusdacoast8722 жыл бұрын

    Good job dude 😎

  • @reputationhemp4011
    @reputationhemp40112 жыл бұрын

    you are doing devil trickery? I literally just thought about doing this bro JUST NOW

  • @Synthetic_geth
    @Synthetic_geth2 жыл бұрын

    Brilliant!

  • @Sinke_100
    @Sinke_1002 жыл бұрын

    My aproach was: with open('image.png', 'rb') as f: data = f.read() text = data.split(b'\x82')[-1].decode() print(text)

  • @YoshiyaMakina

    @YoshiyaMakina

    2 жыл бұрын

    This also works in my case too

  • @gedtoon6451

    @gedtoon6451

    2 жыл бұрын

    I am intrigued, can you please explain what this does?

  • @Sinke_100

    @Sinke_100

    2 жыл бұрын

    @@gedtoon6451 if u hide text in picture with append method last byte is x82 of that png picture (bytes are represented in hex values from 00 till ff) then u split at that value and u get list where your text is now last item in that list, but it is in bytes mode still that is why u also have to decode

  • @gedtoon6451

    @gedtoon6451

    2 жыл бұрын

    @@Sinke_100 But is it not possible for x82 to appear somewhere in the image and then you would split too soon?

  • @Sinke_100

    @Sinke_100

    2 жыл бұрын

    @@gedtoon6451 not that i know of, but it's more convinient to pick last 4 or 5 common bytes for png, so split is more sure, like for example if u use character € in message then u would encounter problems since € sign has x82 in self, or the other solution is when u type message u put spliter already in like $$$.encode() between image and your message, then u split on that, maybe it's even better aproach, but both works fine

  • @gedtoon6451
    @gedtoon64512 жыл бұрын

    Should the last three lines of the lsb encoder be tabbed in, as we do not want to save the encoded file if the the target file was not big enough?

  • @tildesarecool7782
    @tildesarecool77827 ай бұрын

    can't believe i made it through this whole thing. and understood almost parts of it. now all i have to do is hide 2600 roms inside of the box art thumbnail for the 2600 roms. that's fine, right? like one of those non-existent 8-bit machines, like pico-8 and friends that store programs in PNG files. surely I'm not the first one to think of applying this to 2600 roms. have to write a script that re-assembles the rom and throws it to stella. no problem, right? more efficient than the method 2600+ uses (grumble)

  • @Sinke_100
    @Sinke_1002 жыл бұрын

    I didn't try it yet, but i'm not sure if lsb method works outside ascii for example i would definetly need croatian letters 'šđč枊ĐČĆŽ' and each of them has ord bigger then 255, if doesn't work by default how u write it i would definetly need to find some workaround within the program, but first i would have to figure out how it acually works, which is slightly above my current knowledge, but i will give it a shot Solution: In encoder use byte_message = ''.join(f'{ord(c):09b}' for c in message) instead of 08b, then in extractor you should change secret_bits = [secret_bits[i:i+9] for i in range(0, len(secret_bits), 9)] instead of 8 First i tryed with replace metdod, but this is better solution i think, even it takes a bit more space in picture

  • @uday-xyz1523
    @uday-xyz15232 жыл бұрын

    So for the second method we are limited to pixels... can we do the same with videos(since the are series of frames?)

  • @prof.tahseen6104

    @prof.tahseen6104

    2 жыл бұрын

    Yes you can. Just add 1 step to the start and to the end. extract frames ...... ...... ...... re-assemble the video from injected frames

  • @ehsankalateh6785
    @ehsankalateh6785 Жыл бұрын

    Amazing 🤩

  • @andreaf6143
    @andreaf61432 жыл бұрын

    great!

  • @pcgalvintoybonnie2827
    @pcgalvintoybonnie2827 Жыл бұрын

    Real cool video! but a question... how can we execute the hidden .exe file in the image by opening it? i've seen some ppl making that i just don't know how, how to it?

  • @DiamondStumpy
    @DiamondStumpy5 ай бұрын

    i think this is really great, but im having a hard time understanding the process of the python logic your using. i wish it was explained what each little bit inside the code is doing.

  • @rmt3589
    @rmt358911 ай бұрын

    Just watched the JPEG one before this. Looks awesome! Great tool for creating an ARG! My idea is to hide encryption data inside various png. I want to make a Unity Asset Pack with parts that can't be modified. For ARG-stuff. With a game hidden inside that needs to be played in Unity Editor. Plan is for the file structure to be set up, and so fragile that changing a texture, .txt, or script will break everything, but make it so the dev can use all the textures, models, shades, and scripts with no problem. Because a lot of the assets in this will be essentially white noise, hiding a lot of data is perfectly fine. Might even help!

  • @rons96

    @rons96

    Күн бұрын

    any success using JPEG with this code logic?

  • @rmt3589

    @rmt3589

    Күн бұрын

    @@rons96 I haven't tried yet. Still don't have a G to have AR with yet.

  • @rons96

    @rons96

    Күн бұрын

    @@rmt3589 i tried here and understood that JPEG do not store pixels, it's a weird compression that make each file somehow unique. Even if you modify the RGB channel values and save the image, when it loads there're totally new values. It is because JPEG have lossy compression in it's algorithm, so searching a bit i found at least 3 method to do it, but all are very complex. ChatGPT gave the hints but didn't was able to provide a working example. I found a PDF explaining but requires many math skills which i don't have.

  • @UNAPPEAL
    @UNAPPEAL2 жыл бұрын

    could you hide code like a xml script inside of it aswell?

  • @ruthvikas

    @ruthvikas

    2 жыл бұрын

    Can be

  • @guilherme5094
    @guilherme50942 жыл бұрын

    👍!!

  • @philtoa334
    @philtoa3342 жыл бұрын

    Yes.Good.

  • @kamilpadula7152
    @kamilpadula71522 жыл бұрын

    I use this method in 97 xD

  • @jesusdacoast872

    @jesusdacoast872

    2 жыл бұрын

    😎

  • @computechtamil7218
    @computechtamil72182 жыл бұрын

    How to extract meta data from Image

  • @unknown-society8037
    @unknown-society8037 Жыл бұрын

    Uhm sir, how about executing the exe file while in the png

  • 2 жыл бұрын

    how could you do this with xml code?

  • @thomasgoodwin2648
    @thomasgoodwin26482 жыл бұрын

    Or you could hide an image 1/8th the size of the original. I'm kinda surprised this works given that png is a non lossless compressed format.

  • @sukritmanikandan3184

    @sukritmanikandan3184

    2 жыл бұрын

    It works because the PIL library neatly handles all of that for you

  • @sukritmanikandan3184

    @sukritmanikandan3184

    2 жыл бұрын

    Also I'm fairly certain png is lossless

  • @gedtoon6451

    @gedtoon6451

    2 жыл бұрын

    PNG offers various levels of compression, including none, but they are all lossless. You get get back exactly the same image. The steganography would not work with a lossy file format

  • @rons96
    @rons96Күн бұрын

    why it don't work with jpeg files?

  • @Technopawan-dx7fn
    @Technopawan-dx7fn12 күн бұрын

    In my view, if you would use this code, it would be faster.............. you don't need to wait for all the array to convert into bytes import numpy as np import PIL.Image img = PIL.Image.open("result.png", "r") img_arr = np.array(list(img.getdata())) channel = 4 if img.mode == 'RGBA' else 3 pixels = img_arr.size stop_indicator = input("Enter Stop_indicator Code: ") stop_indicator_byte = ''.join(f"{(ord(byte)):08b}" for byte in stop_indicator) index = 0 message_bits = '' for i in range(pixels-1): for j in range(channel): message_bits = message_bits + str(bin(img_arr[i][j])[-1]) index += 1 first_bit = index - len(stop_indicator_byte) if message_bits[first_bit:index] == stop_indicator_byte: break index = 0 message_bytes = '' for i in range(int(len(message_bits)/8)): message_bytes = message_bytes + " " for j in range(8): message_bytes = message_bytes + message_bits[index] index += 1 message_bytes = message_bytes[1:] to_ignore = -len(stop_indicator) message = "".join(chr(int(c, 2)) for c in message_bytes.split(" ")) message = message[:to_ignore] print(message)

  • @hello-my6ot
    @hello-my6ot2 жыл бұрын

    Genious

  • @psychoSherlock
    @psychoSherlock2 жыл бұрын

    First 🙂

Келесі