Skip to main content

Encryption and Emojis!

Encrypt text in the form of emojis and decrypt them back with the help of Cryptmoji

Published 1 min readMarkdown
Encryption and Emojis!

Almost nine months ago, I published my 3rd Python library - Cryptmoji. You may have come across a ton of cryptography libraries on PyPI. Many may be relatively safer, but I aimed to use "Caesar Cipher" and "mapping" to make a fun tool to learn cryptography. To install Cryptmoji, run the following:

pip install cryptmoji

How to use Cryptmoji

Encryption

To encrypt text, we use the encrypt() function.

>>> from cryptmoji import encrypt
>>> text = "H3LL0 W0RLD"
>>> encrypted = encrypt(text)
'馃尵馃寽馃崅馃崅馃寵馃寜馃崓馃寵馃崍馃崅馃尯'

The output is much different than the regular encryption algorithms, isn't it?

Decryption

To decrypt text, we use the decrypt() function.

>>> from cryptmoji import decrypt
>>> encrypted = "馃尵馃寽馃崅馃崅馃寵馃寜馃崓馃寵馃崍馃崅馃尯"
>>> decrypt(encrypted)
'H3LL0 W0RLD'

And Voila! We have our string back!

using the Key parameter

As you can see, the output starts to become predictable after some time. So we need another parameter to shuffle the characters. This Parameter is key. This will drastically change the encrypted string.

For example:

>>> from cryptmoji import encrypt, decrypt
>>> key = "HI_M0M"
>>> encrypted = encrypt("H3LL0 W0RLD", key=key)
>>> encrypted
'馃巼馃嵅馃幃馃帎馃崠馃崳馃帰馃嵂馃幋馃帎馃崻'
>>> decrypt(encrypted, key=key)
'H3LL0 W0RLD'

For more details, refer to the documentation and GitHub repo.

About the author

  • I am a Software Developer. I am fluent in Python JS/TS, PHP and Golang

No comments yet. Be the first to comment.