Skip to content

Hide text in plain sight using zero-width secret space characters.

License

Notifications You must be signed in to change notification settings

darkknight13/spacecrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SpaceCrypt

Hide text in plain sight using zero-width secret space characters.

Encrypt any Text -

$spaceCrypt = new SpaceCrypt("We're not the same text, even though we look the same.");
echo $spaceCrypt->encrypt("This is a Hidden Message.");

this will generate the message - This ‌​‌​‌‌‌⁠‌‌​​‌​‌⁠‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌​‌‌‌​⁠‌‌​‌‌‌‌⁠‌‌‌​‌​​⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌‌​​‌‌⁠‌‌​​​​‌⁠‌‌​‌‌​‌⁠‌‌​​‌​‌⁠‌‌‌​​​‌​⁠‌​​​​​​​⁠‌​​​‌​‌‌⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​​‌​‌⁠‌‌‌‌​​​⁠‌‌‌​‌​​⁠‌​‌‌​​⁠‌​​​​​⁠‌‌​​‌​‌⁠‌‌‌​‌‌​⁠‌‌​​‌​‌⁠‌‌​‌‌‌​⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌‌​​‌‌‌⁠‌‌​‌​​​⁠‌​​​​​⁠‌‌‌​‌‌‌⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌​‌‌​​⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌‌⁠‌‌​‌​‌‌⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌‌​​‌‌⁠‌‌​​​​‌⁠‌‌​‌‌​‌⁠‌‌​​‌​‌⁠‌​‌‌‌​is a Hidden Message.

Now, Decrypt the Hidden Text -

$spaceCrypt = new SpaceCrypt("This ‌​‌​‌‌‌⁠‌‌​​‌​‌⁠‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌​‌‌‌​⁠‌‌​‌‌‌‌⁠‌‌‌​‌​​⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌‌​​‌‌⁠‌‌​​​​‌⁠‌‌​‌‌​‌⁠‌‌​​‌​‌⁠‌‌‌​​​‌​⁠‌​​​​​​​⁠‌​​​‌​‌‌⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​​‌​‌⁠‌‌‌‌​​​⁠‌‌‌​‌​​⁠‌​‌‌​​⁠‌​​​​​⁠‌‌​​‌​‌⁠‌‌‌​‌‌​⁠‌‌​​‌​‌⁠‌‌​‌‌‌​⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌‌​​‌‌‌⁠‌‌​‌​​​⁠‌​​​​​⁠‌‌‌​‌‌‌⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌​‌‌​​⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌‌⁠‌‌​‌​‌‌⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌‌​​‌‌⁠‌‌​​​​‌⁠‌‌​‌‌​‌⁠‌‌​​‌​‌⁠‌​‌‌‌​is a Hidden Message.");
echo $spaceCrypt->decrypt();

this will reveal the actual message - We're not the same text, even though we look the same.

How This Works

SpaceCrypt works by converting your private message into binary data, and then converting that binary data into zero-width characters (which can then be hidden in your public message). These characters are used:

Unicode Character 'WORD JOINER' (U+2060)
Unicode Character 'ZERO WIDTH SPACE' (U+200B)
Unicode Character 'ZERO WIDTH NON-JOINER' (U+200C)

Tests

✅ Slack
✅ Twitter
✅ WhatsApp
✅ Telegram
✅ Keybase
✅ iMessage
✅ MacOS general copy/paste
✅ Hangouts

Inspired from a Article by Zach Aysan

About

Hide text in plain sight using zero-width secret space characters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages