{"id":477,"date":"2024-03-29T22:42:49","date_gmt":"2024-03-29T22:42:49","guid":{"rendered":"https:\/\/anti-forensics.com\/blog\/?p=477"},"modified":"2024-04-20T17:56:17","modified_gmt":"2024-04-20T17:56:17","slug":"lsb-steganography-with-encryption-in-python-using-png-files","status":"publish","type":"post","link":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/","title":{"rendered":"LSB Steganography Password Protect with Encryption in Python using PNG Files"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To read more about LSB Steganography visit: <a href=\"https:\/\/anti-forensics.com\/blog\/lsb-steganography-in-python-using-png-files\/\">LSB Steganography in Python using PNG Files<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This software implements LSB Steganography, as described and demonstrated in the link above, and in addition, message encryption. This way a user can encrypt their hidden message using Fernet, with a passphrase.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Hiding:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Takes an input image and a message to be hidden.<\/li>\n\n\n\n<li>Encrypts the message for enhanced security.<\/li>\n\n\n\n<li>Converts the encrypted message into a binary string.<\/li>\n\n\n\n<li>Embeds the binary message into the least significant bits (LSB) of the image&#8217;s pixels.<\/li>\n\n\n\n<li>Saves the modified image as the output.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Retrieving:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Takes the modified image as input.<\/li>\n\n\n\n<li>Extracts the binary message hidden within the image&#8217;s LSBs.<\/li>\n\n\n\n<li>Converts the binary string back to text.<\/li>\n\n\n\n<li>Decrypts the message to reveal the original secret.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Steganography password protect<\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The first addition to the original LSB Steganography program is the ability to generate an encryption key from a passphrase. The salt is set to a static value within the software. This is because we do not store the salt anywhere else that it can be retrieved from during decryption and encryption. This can be changed but you&#8217;ll need to use the correct salt which is whatever you chose at the time of original encryption.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def get_key() -&gt; bytes:\n    passphrase = getpass.getpass(prompt=\"ENTER PASSPHRASE: \", stream=None)\n\n    salt = b'1234567812345678'\n    kdf = PBKDF2HMAC(\n        algorithm=hashes.SHA256(),\n        length=32,\n        salt=salt,\n        iterations=480000,\n    )\n\n    key = base64.urlsafe_b64encode(kdf.derive(passphrase.encode()))\n    return key<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is done in the &#8220;get_key()&#8221; function, above.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Get User Passphrase:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Calls&nbsp;<code>getpass.getpass(prompt=\"ENTER PASSPHRASE: \", stream=None)<\/code>\n<ul class=\"wp-block-list\">\n<li>Displays the prompt &#8220;ENTER PASSPHRASE: &#8221; to the user.<\/li>\n\n\n\n<li>Securely reads the user&#8217;s inputted passphrase without echoing it to the screen.<\/li>\n\n\n\n<li>Stores the input in the&nbsp;<code>passphrase<\/code>&nbsp;variable.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Define Salt:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>salt = b'1234567812345678'<\/code><\/li>\n\n\n\n<li>Creates a byte string to use as the salt. Salts are random data added during key derivation to make the output less predictable and protect against attacks like rainbow tables.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Initialize Key Derivation Function (KDF):<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>kdf = PBKDF2HMAC(algorithm=hashes.SHA256(), length=32, salt=salt, iterations=480000)<\/code>\n<ul class=\"wp-block-list\">\n<li>Creates a KDF object using the PBKDF2HMAC algorithm.<\/li>\n\n\n\n<li>Specifies the SHA-256 hash function.<\/li>\n\n\n\n<li>Sets the desired output key length to 32 bytes.<\/li>\n\n\n\n<li>Uses the previously defined&nbsp;<code>salt<\/code>.<\/li>\n\n\n\n<li>Sets a high number of iterations (480000) to deliberately slow down the key derivation process, making brute-force attacks more difficult.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Derive Key:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>key = base64.urlsafe_b64encode(kdf.derive(passphrase.encode()))<\/code>\n<ul class=\"wp-block-list\">\n<li>Calls&nbsp;<code>kdf.derive(passphrase.encode())<\/code>&nbsp;to generate the key material from the user&#8217;s passphrase using the configured KDF settings.<\/li>\n\n\n\n<li>Encodes the derived key using base64 (urlsafe variant) to make it easier to transmit or store as text.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Return Key:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>return key<\/code>\n<ul class=\"wp-block-list\">\n<li>Returns the base64-encoded key to be used for encryption or decryption elsewhere in the code.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">The second addition to the code is in the text_to_binary function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def text_to_binary(message: str) -&gt; str:\n    binary_string = ''\n\n<strong>    f = Fernet(get_key())\n\n    message = base64.urlsafe_b64encode(f.encrypt(message.encode())).decode()<\/strong>\n\n    for char in message:\n        binary_char = format(ord(char), '08b')\n        binary_string += binary_char\n\n    return binary_string<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Notice the bolded code lines.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Generate an encryption key:<\/strong><code>f = Fernet(get_key())<\/code>\n<ul class=\"wp-block-list\">\n<li>Calls the&nbsp;<code>get_key()<\/code>&nbsp;function (explained earlier) to get a key for encryption.<\/li>\n\n\n\n<li>Creates a Fernet encryption object, ready to encrypt your message.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Encrypt the message:<\/strong><code>message = base64.urlsafe_b64encode(f.encrypt(message.encode())).decode()<\/code>\n<ul class=\"wp-block-list\">\n<li>Encodes the message into bytes using&nbsp;<code>message.encode()<\/code>.<\/li>\n\n\n\n<li>Encrypts the encoded message using the Fernet object&nbsp;<code>f<\/code>.<\/li>\n\n\n\n<li>Base64 encodes the encrypted data (urlsafe variant) for easier text representation.<\/li>\n\n\n\n<li>Decodes the base64 encoded string back to regular text.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">The third addition to the original tuckerlsb code is in the <code>reveal_message<\/code> method.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    def reveal_message(self, input_image: str) -&gt; str:\n\n        image = Image.open(input_image)\n        pixels = image.load()\n\n        binary_message = ''\n\n        for row in range(image.size&#91;0]):\n            for column in range(image.size&#91;1]):\n                pixel = pixels&#91;column, row]\n                least_significant_bit = pixel&#91;0] &amp; 1\n                binary_message += str(least_significant_bit)\n\n                if binary_message.endswith(self.delimiter):\n                    binary_message = binary_message&#91;:-16]  # Remove the delimiter\n                    message = binary_to_text(binary_message)\n\n<strong>                    f = Fernet(get_key())\n                    message = f.decrypt(base64.urlsafe_b64decode(message)).decode()<\/strong>\n\n                    return message\n\n        return \"ERROR\"<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Decrypt Message:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>f = Fernet(get_key())<\/code>: Creates a Fernet decryption object using the key generated by the&nbsp;<code>get_key()<\/code>&nbsp;function.<\/li>\n\n\n\n<li><code>message = f.decrypt(base64.urlsafe_b64decode(message)).decode()<\/code>: Decrypts the message using the Fernet object and decodes the base64 encoded decrypted data.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Steganography password protect<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Downloads<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/Anti-Forensics\/tuckerenc\/tree\/master\" target=\"_blank\" rel=\"noreferrer noopener\">LSB Steganography GitHub<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/Anti-Forensics\/tuckerenc\/releases\/tag\/v1.0\">tuckerenc x86_64 Windows exe<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This software implements LSB Steganography password protect, as described and demonstrated in the link above, and in addition, message encryption. This way a user can encrypt their hidden message using Fernet, with a passphrase.<\/p>\n","protected":false},"author":1,"featured_media":481,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,24],"tags":[56,69,13,41,70],"class_list":["post-477","post","type-post","status-publish","format-standard","has-post-thumbnail","category-digital-forensics","category-software-code","tag-cryptography","tag-lsb","tag-python","tag-source-code","tag-steganography"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>LSB Steganography Password Protect with Encryption in Python using PNG Files - Anti-Forensics.com<\/title>\n<meta name=\"description\" content=\"This software implements LSB Steganography password protect, as described and demonstrated in the link above, and in addition, message encryption. This way a user can encrypt their hidden message using Fernet, with a passphrase.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LSB Steganography Password Protect with Encryption in Python using PNG Files - Anti-Forensics.com\" \/>\n<meta property=\"og:description\" content=\"This software implements LSB Steganography password protect, as described and demonstrated in the link above, and in addition, message encryption. This way a user can encrypt their hidden message using Fernet, with a passphrase.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/\" \/>\n<meta property=\"og:site_name\" content=\"Anti-Forensics.com\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/stercutis\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-29T22:42:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-20T17:56:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/03\/anti-forensics.com-lsb-steganography-with-encryption.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Max\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Max\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/\"},\"author\":{\"name\":\"Max\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#\\\/schema\\\/person\\\/ac3dd160cb42b1409a2a55dea58beec2\"},\"headline\":\"LSB Steganography Password Protect with Encryption in Python using PNG Files\",\"datePublished\":\"2024-03-29T22:42:49+00:00\",\"dateModified\":\"2024-04-20T17:56:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/\"},\"wordCount\":535,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/anti-forensics.com-lsb-steganography-with-encryption.jpg\",\"keywords\":[\"cryptography\",\"lsb\",\"python\",\"source code\",\"steganography\"],\"articleSection\":[\"Digital Forensics\",\"Software\\\/Code\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/\",\"name\":\"LSB Steganography Password Protect with Encryption in Python using PNG Files - Anti-Forensics.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/anti-forensics.com-lsb-steganography-with-encryption.jpg\",\"datePublished\":\"2024-03-29T22:42:49+00:00\",\"dateModified\":\"2024-04-20T17:56:17+00:00\",\"description\":\"This software implements LSB Steganography password protect, as described and demonstrated in the link above, and in addition, message encryption. This way a user can encrypt their hidden message using Fernet, with a passphrase.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/#primaryimage\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/anti-forensics.com-lsb-steganography-with-encryption.jpg\",\"contentUrl\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/anti-forensics.com-lsb-steganography-with-encryption.jpg\",\"width\":1024,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/lsb-steganography-with-encryption-in-python-using-png-files\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LSB Steganography Password Protect with Encryption in Python using PNG Files\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/\",\"name\":\"Anti-Forensics.com\",\"description\":\"Rendering Digital Investigations Irrelevant\",\"publisher\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#organization\",\"name\":\"Anti-Forensics.com\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/cropped-anti-forensics.com_.jpg\",\"contentUrl\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/cropped-anti-forensics.com_.jpg\",\"width\":512,\"height\":512,\"caption\":\"Anti-Forensics.com\"},\"image\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/groups\\\/14345620\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#\\\/schema\\\/person\\\/ac3dd160cb42b1409a2a55dea58beec2\",\"name\":\"Max\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g\",\"caption\":\"Max\"},\"description\":\"Anti-forensics involves attempts to hide data, damage the confidentiality, integrity, and availability of data in an effort to make analysis and examination of this data (evidence) difficult or impossible.\",\"sameAs\":[\"https:\\\/\\\/anti-forensics.com\\\/blog\",\"https:\\\/\\\/facebook.com\\\/stercutis\",\"https:\\\/\\\/linkedin.com\\\/in\\\/jesse-shelley\"],\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/author\\\/realjesseshelley_hkwwlra2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LSB Steganography Password Protect with Encryption in Python using PNG Files - Anti-Forensics.com","description":"This software implements LSB Steganography password protect, as described and demonstrated in the link above, and in addition, message encryption. This way a user can encrypt their hidden message using Fernet, with a passphrase.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/","og_locale":"en_US","og_type":"article","og_title":"LSB Steganography Password Protect with Encryption in Python using PNG Files - Anti-Forensics.com","og_description":"This software implements LSB Steganography password protect, as described and demonstrated in the link above, and in addition, message encryption. This way a user can encrypt their hidden message using Fernet, with a passphrase.","og_url":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/","og_site_name":"Anti-Forensics.com","article_author":"https:\/\/facebook.com\/stercutis","article_published_time":"2024-03-29T22:42:49+00:00","article_modified_time":"2024-04-20T17:56:17+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/03\/anti-forensics.com-lsb-steganography-with-encryption.jpg","type":"image\/jpeg"}],"author":"Max","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Max","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/#article","isPartOf":{"@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/"},"author":{"name":"Max","@id":"https:\/\/anti-forensics.com\/blog\/#\/schema\/person\/ac3dd160cb42b1409a2a55dea58beec2"},"headline":"LSB Steganography Password Protect with Encryption in Python using PNG Files","datePublished":"2024-03-29T22:42:49+00:00","dateModified":"2024-04-20T17:56:17+00:00","mainEntityOfPage":{"@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/"},"wordCount":535,"commentCount":0,"publisher":{"@id":"https:\/\/anti-forensics.com\/blog\/#organization"},"image":{"@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/#primaryimage"},"thumbnailUrl":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/03\/anti-forensics.com-lsb-steganography-with-encryption.jpg","keywords":["cryptography","lsb","python","source code","steganography"],"articleSection":["Digital Forensics","Software\/Code"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/","url":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/","name":"LSB Steganography Password Protect with Encryption in Python using PNG Files - Anti-Forensics.com","isPartOf":{"@id":"https:\/\/anti-forensics.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/#primaryimage"},"image":{"@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/#primaryimage"},"thumbnailUrl":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/03\/anti-forensics.com-lsb-steganography-with-encryption.jpg","datePublished":"2024-03-29T22:42:49+00:00","dateModified":"2024-04-20T17:56:17+00:00","description":"This software implements LSB Steganography password protect, as described and demonstrated in the link above, and in addition, message encryption. This way a user can encrypt their hidden message using Fernet, with a passphrase.","breadcrumb":{"@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/#primaryimage","url":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/03\/anti-forensics.com-lsb-steganography-with-encryption.jpg","contentUrl":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/03\/anti-forensics.com-lsb-steganography-with-encryption.jpg","width":1024,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/anti-forensics.com\/blog\/lsb-steganography-with-encryption-in-python-using-png-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/anti-forensics.com\/blog\/"},{"@type":"ListItem","position":2,"name":"LSB Steganography Password Protect with Encryption in Python using PNG Files"}]},{"@type":"WebSite","@id":"https:\/\/anti-forensics.com\/blog\/#website","url":"https:\/\/anti-forensics.com\/blog\/","name":"Anti-Forensics.com","description":"Rendering Digital Investigations Irrelevant","publisher":{"@id":"https:\/\/anti-forensics.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/anti-forensics.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/anti-forensics.com\/blog\/#organization","name":"Anti-Forensics.com","url":"https:\/\/anti-forensics.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/anti-forensics.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/cropped-anti-forensics.com_.jpg","contentUrl":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/cropped-anti-forensics.com_.jpg","width":512,"height":512,"caption":"Anti-Forensics.com"},"image":{"@id":"https:\/\/anti-forensics.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/groups\/14345620\/"]},{"@type":"Person","@id":"https:\/\/anti-forensics.com\/blog\/#\/schema\/person\/ac3dd160cb42b1409a2a55dea58beec2","name":"Max","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g","caption":"Max"},"description":"Anti-forensics involves attempts to hide data, damage the confidentiality, integrity, and availability of data in an effort to make analysis and examination of this data (evidence) difficult or impossible.","sameAs":["https:\/\/anti-forensics.com\/blog","https:\/\/facebook.com\/stercutis","https:\/\/linkedin.com\/in\/jesse-shelley"],"url":"https:\/\/anti-forensics.com\/blog\/author\/realjesseshelley_hkwwlra2\/"}]}},"_links":{"self":[{"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/posts\/477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/comments?post=477"}],"version-history":[{"count":6,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/posts\/477\/revisions"}],"predecessor-version":[{"id":532,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/posts\/477\/revisions\/532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/media\/481"}],"wp:attachment":[{"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/media?parent=477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/categories?post=477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/tags?post=477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}