Skip to main content

An encryption tool, designed for CTF challenges and fun purposes.

Project description


Memecrypt is an encryption tool designed for fun and CTF challenge use. It can be imported as a python module or used as a standalone program, depending on whichever is needed.

GitHub forks GitHub stars GitHub watchers


There are 2 main ways to use memecrypt. Both ways are covered here.

Program use

Install from PyPi

$ python3 -m pip install memecrypt


Let's start by viewing all the supported arguments.

$ memecrypt
[+] Usage: memecrypt [options]

[i] Examples:

      memecrypt -se -i foo -k bar

      memecrypt --subs -x -f file.txt -k "a_key"

      memecrypt -sx -i 'lorem ipsum' -k 'some key'

      memecrypt --subs -e -u -k 'ascii cat'

[i] Positional arguments:

       -s --subs
              Select the substitution cipher.
       -e --encrypt
              Select encryption mode.
       -x --decrypt
              Select decryption mode.
       -k --key key
              Specify key.
       -i --input input-string
              Specify input string.
       -u --url url
              GETs data from the url.
       -f --file file-path
              Specify input file path.

[i] Optional arguments:

       -h --help
              Show this help screen and exit.
       -v --version
              Print version and exit.
       -q --quiet
              Only show output. Any errors are still displayed.
       -o --output-file file
              Specify a file to write to.
       -p --pipe-input
              Take input from stdin.


# As an argument
$ ./ -se -i "foo bar" -k "lorem ipsum"
[!] Note: Please use the same key for decryption.
[+] Encrypted result:

# From a URL
$ ./ --subs --encrypt --url --key "cat"
[+] Fetched data from URL.
[!] Note: Please use the same key for decryption.
[+] Encrypted result:
WiJeTFoiXkxaOl5ETDpeREw6XkRMOl5ET.....(and so on).....

# From a local file
$ ./ -se -f <file-path> -k "foobar" -q
NWl8eSlMd35ZXTQxU289Y0ZdNGdGTCdrU2FBQ3pM...(and so on)...


# Decrypt as an argument.
./ -sx -i bVQ0cjJfVkY1TGNCKFRWWzIkZVF... -k wow
[+] Decrypted result:
Much encryption, very wow

# Decrypt from file
$ ./ --subs --decrypt -f ../../projects/outputfile -k lol
[+] Decrypted result:
Cupcake ipsum dolor. Sit amet topping chocolate bar


Arguments can be placed in any order and combined however you want, as long as they don't need a passed value or directly contradict.

Module use

Install using python3 -m pip install memecrypt


Let's start by creating an instance of the meme_cipher class.

# Import our module
import memecrypt

# Create an instance
cipher = memecrypt.meme_cipher(message=None, enc_key=None, show_colors=True)

# message is the message to work on
# enc_key is the key
# show_colors=False to turn off all colors

Setting a message

Set message using method or attribute.

# Using our previous instance

# We can access/modify this by accessing the message attribute
# Prints: foo

# Let's try and set a blank message.
# Prints: [!] Memecrypt: Plaintext/Ciphertext cannot be empty.

Setting a key

This works the same way as setting a message. We'll use our cipher instance. Again, the key cannot be blank or None.

# Setting a key

# We can access/modify the key from the enc_key attribute
# Prints: bar

# Same as before, we can't set a blank key
# Prints: [!] Memecrypt: Key value cannot be empty.


Encrypt the values. If key or message is missing, error.

# message => foo, key => bar
# Returns: 'NEgydQ=='


Perform decryption

# message => NEgydQ==, key=> bar
# Returns: 'foo'

Input sources

Take input from file.

# transfer the contents of the url.
cat = cipher.fetch_url("")
# Returns a ascii cat.
# We just set our message as the ascii cat!

# Read a local file.
foo_file = cipher.read_file("/path/to/file/file.txt")
# foo_file will have contents of file.txt

# Set our message to contents of file.txt

Output files

Write output to a file.

# Append to a file. Create file if file non-existent.
cipher.write_to("path/to/file/file.txt", "lorem ipsum dolor")

# Let's put our encrypted output to a file.
cipher.write_to("foo_bar.txt", cipher.encrypt())

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for memecrypt, version 1.5.0
Filename, size File type Python version Upload date Hashes
Filename, size memecrypt-1.5.0-py3-none-any.whl (8.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size memecrypt-1.5.0.tar.gz (9.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page