-
-
Notifications
You must be signed in to change notification settings - Fork 18
Adding To Cryptex
Alex Kollar edited this page Oct 20, 2022
·
1 revision
So you are interested in adding a new cipher to Cryptex? We have packaged a template file into Cryptex's source.
- Head over to
/path/to/Cryptex/src/cipher/ciphers
- Open
template.py
in your favorite code editor. - Edit the code as per explained in the comments.
- Test test test.
- 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.
"""
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'
''')
Coming Soon...ish.
If you face any problems while using the application, please open an issue here
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.