Skip to main content

Hiding

Just a random python lib that extremely inefficiently hides text in other text.


Introduction

Hiding is a very simple 25 LOC lib that allows hiding text inside text. It could be seen as a rudimentary text based steganography. In fact, during drafting stages, this project was known as "testegano" - a portmanteau of "text" and "stegano".

Uses

Please don't use this in production. This is more a proof of concept than a useful​‌​‌‌​​‌​‌‌​​‌​‌​‌‌‌​​‌‌​​‌​‌‌​​​​‌​​​​​​‌‌​‌‌‌‌​‌‌​​‌‌​​​‌​​​​​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌‌​‌​‌​‌‌‌​​‌​​‌‌‌​​‌‌​‌‌​​‌​‌​​‌​​​​​​‌​​‌​​‌​​‌​​‌‌‌​‌‌​‌‌​‌​​‌​​​​​​‌‌​​‌‌‌​‌‌​‌‌‌‌​‌‌​‌​​‌​‌‌​‌‌‌​​‌‌​​‌‌‌​​‌​​​​​​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​​​​​​‌‌​‌​​​​‌‌​‌​​‌​‌‌​​‌​​​‌‌​​‌​‌​​‌​​​​​​‌‌​‌‌​‌​‌‌​​‌​‌​‌‌‌​​‌‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​​‌‌‌​‌‌​​‌​‌​‌‌‌​​‌‌​​‌​​​​​​‌‌​‌​​‌​‌‌​‌‌‌​​​‌​​​​​​‌‌​‌​​​​‌‌​​‌​‌​‌‌‌​​‌​​‌‌​​‌​‌​​‌​‌‌‌​ lib. While it can be useful to hide some text, it's unfeasible to use this for any text bigger than 5 characters. It is less secure than conventional image based stegano, as some editors either show the unicode or show them as spaces.

Theory

The unicode consortium was founded to make a universial code (as the name suggests). This means they have to factor in edge cases like CJK characters who doesn't have conventional spaces. That's why they've made 2 types of "invisible" space characters. \u200b and \u200c. Hiding exploits that by converting the message from ascii into binary, then writing the message in the middle of the string, \u200b for 0, \u200c for 1. Because they do not break the text, it would be hard for a naked eye to see them (unless of course, someone puts it in a character count or tries to delete the text by backspace).

Limitations

  • Because everything is stored in binary, the hidden length will be eight times longer than the normal length. This means you can't hide essaies in text :(.

  • It uses ascii, which means diacritics and non-latin letters won't be supported.

  • It's a literal PITA to deal with the text. You'll have to be careful wit​‌​‌​‌‌‌​‌‌​​‌​‌​‌‌​‌‌​​​‌‌​‌‌​​​​‌​​​​​​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​‌‌‌​​‌‌​​‌​‌​​‌​​​​​​‌‌​​‌‌​​‌‌​‌​​‌​‌‌​‌‌‌​​‌‌​​‌​​​‌‌​‌​​‌​‌‌​‌‌‌​​‌‌​​‌‌‌​​‌​​​​​​‌‌​‌‌​‌​‌‌​​‌​‌​​‌​​​​​​‌‌‌​‌​​​‌‌​‌​​​​‌‌​‌‌‌‌h it because it's invisible.

Installation

Install it like any other pypi module. python -m pip install hiding

Manual Install

If you are the type of person to install manu​‌​​‌‌​​​‌‌‌​‌​‌​‌‌​‌​‌‌​‌‌​​‌​‌​​‌​​​​​​‌​​‌​​‌​​‌​​​​​​‌‌​‌​​​​‌‌​​​​‌​‌‌‌​‌‌​​‌‌​​‌​‌​​‌​​​​​​‌‌​​​​‌​​‌​​​​​​‌‌​​​‌‌​‌‌‌​​‌​​‌‌‌​‌​‌​‌‌‌​​‌‌​‌‌​‌​​​​​‌​​​​​​‌‌​‌‌‌‌​‌‌​‌‌‌​​​‌​​​​​​‌‌‌‌​​‌​‌‌​‌‌‌‌​‌‌‌​‌​‌​​‌​​​​​​​‌‌‌​‌‌​​‌​‌​​‌ally then you don't need to read this guide.

Usage

Since there are only 2 functions, it's better to import them directly. Unless they clash with other functions, in which case you may want to use aliases or just import the whole module.

from hiding import hide, show

Now, you've got the two functions. Simply call them whenever you want to hide or show text. Remember you can only hide very short messages.

from hiding import hide, show

print(hide("This is a long string of text.","secretmsg"))

The above should return "This is a long ​‌‌‌​​‌‌​‌‌​​‌​‌​‌‌​​​‌‌​‌‌‌​​‌​​‌‌​​‌​‌​‌‌‌​‌​​​‌‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​‌‌‌string of text.". The usage of hide() is hide("Public-facing text","Message to hide"). Upon success, it returns a string - the first argument with the message hidden in it.

To get the secret message back from a hidden text, you may use the show() function.

from hiding import hide, show
print(show("This is a long ​‌‌‌​​‌‌​‌‌​​‌​‌​‌‌​​​‌‌​‌‌‌​​‌​​‌‌​​‌​‌​‌‌‌​‌​​​‌‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​‌‌‌string of text."))

Show only takes 1 argument, the hidden text. It either returns a string or a None. The None will be returned when the message could not be found. This way, you could check if something contains a message simply by if show("Message Here"):. As it would return false if there isn't a message.

Support

You are discouraged to use this lib for anything important, but I am happy to give support. Email me at contact@johnngnky.xyz and I'd love to help.

License

Do whatever the fuck you want. .

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                    Version 2, December 2004

 Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FUCK YOU WANT TO.

Release files for hiding 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hiding 0.0.8
File Size Uploaded
hiding-0.0.8.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hiding 0.0.8
File Interpreter ABI Platform
hiding-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / hiding-0.0.8.tar.gz

Download URL hiding-0.0.8.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3f77168672f9af2fafb1805b9db8094128e2489fba47060ee166a47b3f0644d4
BLAKE2b-256 checksum
How to use checksums
eb904e12f3a643a6c2a972411cd5f8ffc198979328ae46c4a06577f9305794f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / hiding-0.0.8-py3-none-any.whl

Download URL hiding-0.0.8-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4403e650ed22b4a40f331c62a4c2f2a695cadaeb645d96fe533251f29ef663cc
BLAKE2b-256 checksum
How to use checksums
eac4c79d6057781895bc30feb406478d14fa1510a58c1d88a8f392da950c706a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page