Skip to content

Adding To Cryptex

Alex Kollar edited this page Oct 20, 2022 · 1 revision

Adding new Ciphers.

So you are interested in adding a new cipher to Cryptex? We have packaged a template file into Cryptex's source.

  1. Head over to /path/to/Cryptex/src/cipher/ciphers
  2. Open template.py in your favorite code editor.
  3. Edit the code as per explained in the comments.
  4. Test test test.
  5. Open a PR requesting to add your code into Cryptex's base system.

I included a copy of template.py below so you can take a look and see its not so daunting.

template.py

"""
Author: @marvhus | Edits: Alex
Instructions:
    Rename the "Template" class to whatever cipher you are working on.
    Edit the encode and decode defs as required to encode or decode your cipher.
    make sure you add the following to __init__.py: from cipher file import *
    Doing this will link the code to main.py 
"""
from cipher import Cipher

class Template(Cipher): #make sure you change this from text to your cipher

    name = 'Plain text cipher' #change the name
    type = 'template'

    def encode(args):
        text = args.text

        if not text:
            return {'text': "No input text", 'success': False}

        # Here is where you put your encoding / encrypting code.

        return {'text': text, 'success': True}

    def decode(args):
        text = args.text

        if not text:
            return {'text': "No input text", 'success': False}

        #Here is where you put your decoding / decrypting code.

        return {'text': text, 'success': True}

    def print_options():
        #Edit this section as needed for your specific encoding / decoding.
        print(''' 
        ### Modes
        -d / --decode ---- decode
        -e / --encode ---- encode

        ### Input
        -t / --text ------ input text

        ### Examples
        python main.py text -e -t 'hello'
        python main.py text -d -t 'hello'
        ''')

Cryodes

Coming Soon...ish.

Wiki Sidebar


🖐️ Get in touch

You can join in on chatting with the dev team on our discord server

Discord Server

🔧 Issues

If you face any problems while using the application, please open an issue here

🤝 Contributing

Contributions, feedback, and bug reports are welcome! Feel free to check out our issues page to find out what you could do! but before contrubuting make sure to check out CONTRIBUTING.md.

Clone this wiki locally