{"id":24320129,"url":"https://github.com/badr-1/steganography-cryptography","last_synced_at":"2025-04-13T20:44:31.600Z","repository":{"id":90137926,"uuid":"584538641","full_name":"Badr-1/steganography-cryptography","owner":"Badr-1","description":"Console App That Uses Cryptography And Steganography  To Embed/Extract Secret Message In/From an Image ","archived":false,"fork":false,"pushed_at":"2023-01-03T09:58:00.000Z","size":1528,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T20:44:30.263Z","etag":null,"topics":["encryption","kotlin","lsb-steganography","security","xor-encryption"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Badr-1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-02T21:21:34.000Z","updated_at":"2025-02-24T08:03:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"cddb1f60-e979-42ad-aadd-9fa99140a556","html_url":"https://github.com/Badr-1/steganography-cryptography","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badr-1%2Fsteganography-cryptography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badr-1%2Fsteganography-cryptography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badr-1%2Fsteganography-cryptography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badr-1%2Fsteganography-cryptography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Badr-1","download_url":"https://codeload.github.com/Badr-1/steganography-cryptography/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782280,"owners_count":21160716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encryption","kotlin","lsb-steganography","security","xor-encryption"],"created_at":"2025-01-17T15:47:49.776Z","updated_at":"2025-04-13T20:44:31.563Z","avatar_url":"https://github.com/Badr-1.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Steganography and Cryptography - Text in Image\n\n## About\n\nEncryption is sometimes not enough to secure you secrets,\nas your secret is known to be passed the only problem is the key is unknown,\nbut that's only one Wall of protection, a smarter way is to hide your secret in plain sight,\nHow can you do that? I hear you asking, **Answer** is **Steganography**, with it, you can Hide your secret\nafter being encrypted in a picture, that would be anywhere on the web, and only you and the receiver would know how to\nextract this secret.\n\n## Overview\n\nThis App is straight forward, it works both ways:\n\n- injecting secrets, require\n    - Path to an Image\n    - Path to output Image with secret hidden in it\n    - Secret obviously\n    - Password to encrypt the secret to ensure that even if the message is extracted it wouldn't be known without the\n      password\n- extracting secrets\n    - Path to Image with secret\n    - Password to decrypt the extracted secret\n\n## Encryption\n\nExclusive OR (XOR) is a logical operation whose output is only true when its inputs differ.\nXOR can also be used on data bits where `1` stands for `true` and `0` stands for `false`.\nBelow you can find both the XOR truth table (on the left) with the input and output values of the XOR operation and the\nXOR bitwise operation (on the right).\n\n![](screenshots/tables.png)\n\nXOR has an interesting mathematical feature: A XOR B = C and C XOR B = A. If A is the message and B the password, then C\nis the encrypted message. Using B and C, we can reconstruct A.\nBelow is an example where we use Bytes as a message, a password, and an encrypted message:\n\n![](screenshots/encryption.png)\n\nThus, not only the same password can be used for encryption and decryption **(symmetric encryption)**, but also the same\nsimple method.\nThis encryption is very strong if the password is random and has the same size as the message.\n\n## Injection Algorithm\n\nI used [LSB Technique](https://www.ijltet.org/wp-content/uploads/2015/02/60.pdf) to Hide The Secret, but I only use the\nblue channel\n\nThe message to hide has the String type and **UTF-8 charset**.\nAs a result, the message can be in any language.\nIn order to conceal the secret message, I converted The message to ByteArray and Then stored each byte bits in the Image\nrespectively, as in figure below\n\n![](screenshots/order3.png)\n\nThen Added three bytes (0,0,3) to denote the end of the message\n\n![](screenshots/injection.png)\n\n## Disclaimer\n\nAlthough Steganography is a promising way for securing data,\nthe algorithm used in this program is primitive and can easily be detected via **Steganalysis**\n\n## Screenshots\n\n### How to Inject Your secret in an Image\n\n![](screenshots/hidding.png)\n\n### Extracting Secret With Correct Password\n\n![](screenshots/showing-correct.png)\n\n### Extracting Secret With Wrong Password\n\n![](screenshots/showing-wrong.png)\n\n### Image Before and After Injection\n\n#### Before\n![Before](/screenshots/example.png)\n#### After\n![After](/screenshots/out.png)\n\n**Fun Fact**\nYou'll see a Japanese Symbol [㊙](https://en.wiktionary.org/wiki/%E7%A7%98) When Entering Your Secret Which also Means\nSecret\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadr-1%2Fsteganography-cryptography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadr-1%2Fsteganography-cryptography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadr-1%2Fsteganography-cryptography/lists"}