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.

2
Subscribe to my newsletter

Read articles from Siddhesh Agarwal directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Siddhesh Agarwal
Siddhesh Agarwal

I am a CSE Student from Coimbatore, India.