Skip to content

Commit

Permalink
V:1.0.0 Pumpkin Patch (#46)
Browse files Browse the repository at this point in the history
* beta branch

* banner styling & readme update

* update readme

* update to banner generation

* add gaderypoluki.py (#50)

* add gaderypoluki.py

* fix

* bug fixes

* Update update.py

Co-authored-by: Martin <marvahus@proton.me>
Co-authored-by: Martin <44480334+marvhus@users.noreply.github.com>

* Updated README.md (#56)

* Update README.md

Removed guide on how to use cryptex, and linked to wiki.

Changed version number for Pumpkin Patch from V0.1.0 to V1.0.0

* Update CONTRIBUTING.md

Added instructions for adding featured in the beta branch

* added sha 224, 256, 384 hash algorithms (#57)

* cryoads setup

* loki resolves

* added sha 224, 256, 384 hash algorithms

Co-authored-by: Shepherd <81541045+ItsJustShepherd@users.noreply.github.com>
Co-authored-by: Alex Kollar <89718570+AlexKollar@users.noreply.github.com>
Co-authored-by: Martin <44480334+marvhus@users.noreply.github.com>

* add pb cipher (#60)

Co-authored-by: Martin <marvahus@proton.me>

* Update README.md

* Update README.md

* Update CONTRIBUTING.md

* Made lots of tweaks to the grammar, spellings, and made the overall text sound more concise. (#61)

* Update README.md

* Update CONTRIBUTING.md

* Made lots of tweaks to the grammar, spellings, and made the overall text sound more concise.

Co-authored-by: Martin <44480334+marvhus@users.noreply.github.com>

* Fixed SE error where it overwrote the image content

* add tests (#47)

* add test

* added tests fro cc, and text

* Added some tests, and exceptions

* Added tests

* Added some tests

- r47 -- Rot 47
- rc --- Reverse Cipher

* B64 test

* Updates to ciphers and requirements

- Changed required googletrans version from 3.0.0 to 3.1.0a0
- Added test for L33T.py
- Added test for mor.py
- Added test for oct.py
- Added test for translate.py
- Added test for vig.py
- Added test for xor.py

	modified:   requirements.txt
	modified:   src/cipher/ciphers/L33T.py
	modified:   src/cipher/ciphers/mor.py
	modified:   src/cipher/ciphers/oct.py
	modified:   src/cipher/ciphers/translate.py
	modified:   src/cipher/ciphers/vig.py
	modified:   src/cipher/ciphers/xor.py

* feat: Add Affine Cipher (#66)

* Update README.md

* Update CONTRIBUTING.md

* add affine cipher

Co-authored-by: Martin <44480334+marvhus@users.noreply.github.com>
Co-authored-by: Martin <marvahus@proton.me>

* feat: Add Playfair Cipher (#67)

* Update README.md

* Update CONTRIBUTING.md

* add playfair cipher

Co-authored-by: Martin <44480334+marvhus@users.noreply.github.com>
Co-authored-by: Martin <marvahus@proton.me>

* final preparations for merge

Co-authored-by: bmalvo <95172679+bmalvo@users.noreply.github.com>
Co-authored-by: Sowham Bhuin <108983339+sb-decoder@users.noreply.github.com>
Co-authored-by: R C N <plbwymw@gmail.com>
Co-authored-by: Shepherd <81541045+ItsJustShepherd@users.noreply.github.com>
Co-authored-by: Alex Kollar <89718570+AlexKollar@users.noreply.github.com>
Co-authored-by: mastdev <44112399+mastdev@users.noreply.github.com>
Co-authored-by: dia <54020066+dianosaur12@users.noreply.github.com>
  • Loading branch information
8 people authored Oct 31, 2022
1 parent 1c07649 commit b953983
Show file tree
Hide file tree
Showing 30 changed files with 907 additions and 62 deletions.
27 changes: 8 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing to Cryptex 🤝
Firstly, thank you for taking the time to contribute.
<br/>
We welcome contributions from anyone willing to improve this project or add new features and you may see historic contributors on the repositories page on the right-hand panel.
We welcome contributions from anyone willing to improve this project or add new features. You may see historic contributors on the repositories page on the right-hand panel.
<br/>
Contribution guidelines are listed below. Please take the time to go through the guidelines and follow them so that it is easy for maintainers to merge or address your contributions.
</br>
Expand Down Expand Up @@ -31,7 +31,7 @@ This project and everyone participating in it is governed by the [Cryptex Code o

## First time Contributor

As a first time contributor if you are not sure about contributing, feel free to ask our dev team on our [Discord Server](https://discord.gg/899KQFeAXr)
As a first-time contributor, if you are not sure about contributing, feel free to ask our dev team on our [Discord Server](https://discord.gg/899KQFeAXr)
<br/>
A good place to start would be our list of [good first issues](https://github.com/SSGorg/Cryptex/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)

Expand All @@ -42,25 +42,21 @@ A good place to start would be our list of [good first issues](https://github.co
- Every change in this project must have an associated issue. **Issue before PR**

### Legal Notice
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content, and that the content you contribute may be provided under the project license.
To start contributing to this project, follow the steps below.

### Fork the Project

- Fork this repository. This will create a local copy of this repository on your github profile.
- Fork this repository. This will create a local copy of this repository on your GitHub profile.

<a href='https://postimages.org/' target='_blank'><img src='https://i.postimg.cc/J4pdgJZH/Screenshot-2022-10-10-at-18-51-49.png' border='0' alt='Fork Repository'/></a>

- Now clone the forked repository on your local machine
- Now clone the forked repository on your local machine.

```bash
git clone https://github.com/<your-username>/Cryptex.git
```
For the [beta branch](https://github.com/SSGorg/Cryptex/tree/beta):
```bash
git clone https://github.com/<your-username>/Cryptex.git -b beta
```

- Keep a reference to the original project in `upstream` remote.

Expand All @@ -76,12 +72,6 @@ To start contributing to this project, follow the steps below.
git checkout -b main
git rebase upstream/main
```
For the [beta branch](https://github.com/SSGorg/Cryptex/tree/beta):
```bash
git remote update
git checkout -b beta
git rebase upstream/beta
```

### Create a new branch

Expand All @@ -97,7 +87,7 @@ git checkout -b branch_name

- Work on the issue assigned to you.
- Add all the files/folders needed.
- After you've made your contribution to the project add changes to the branch you've just created:
- After you've made your contribution to the project, add changes to the branch you've just created:

```bash
# To add all new files to branch branch_name
Expand Down Expand Up @@ -125,17 +115,16 @@ git push -u origin branch_name

### Pull Request

Go to your repository in the browser and click on compare and pull requests.
Go to your repository on your web browser and click on 'Compare and pull request'.
This will send a request to the maintainer to add your contribution to the main repository `https://github.com/SSGorg/Cryptex`
<br/>
Add a title to your Pull Request.
<br/>Make sure to mention which issue is solved with this Pull Request by mentioning the issue number #. Then add a description to your Pull Request that explains your contribution.
<br/>
#### **Note:** Make sure you are synched up to the [beta branch](https://github.com/SSGorg/Cryptex/tree/beta), and make your pull request merge into the [beta branch](https://github.com/SSGorg/Cryptex/tree/beta).

### Review

🎉🌟Congratulations! Sit and relax, you've made your contribution to Cryptex project. Wait until the PR is reviewed and incorporate changes suggested by the reviewers. After which the PR can be successfully merged.
🎉🌟Congratulations! Now sit and relax, you've made your contribution to the Cryptex project. Wait until the PR is reviewed and changes are incorporated as suggested by the reviewers, after which the PR can be successfully merged.

## Other Ways to Contribute

Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<h3>Locks only exist to keep honest people honest</h3>
</div>

# V:1.0.0 Pumpkin Patch

<p align="center">
<a href="https://github.com/SSGorg/Cryptex/blob/main/LICENCE"><img src="https://img.shields.io/badge/license-AGPL%20%203.0-0d1117?style=flat-square" alt="GitHub License"></a>
<a href="https://github.com/SSGorg/Cryptex/issues"><img src="https://img.shields.io/github/issues/SSGorg/Cryptex?color=0d1117&style=flat-square" alt="GitHub Issues">
Expand All @@ -21,38 +23,39 @@
- [Our Amazing Contributors](#our-amazing-contributors)

## 📖 History
Cryptex started out in November 2021 with one developer Alex "cythes" Kollar as an attempt to be less of a script kiddy.
It has since became so much more. As of april 2022 Alex decided to open the project up to the SSG community to some absolutely incredible results. At this point the SSG | Cryptex Dev Team was founded with a the idea of building cryptex into a cryptography tool that people could use, install and add to with ease. Similar to metasploit. The project and team has evolved so much in just the little time it has existed.
Cryptex started out in November, 2021, with one developer, Alex "cythes" Kollar, as an attempt to be less of a script kiddie.
It has since then became so much more. As of April, 2022, Alex decided to open the project up to the SSG community to reap some absolutely incredible results. At this point, the SSG | Cryptex Dev Team was founded with a the idea of building Cryptex into a cryptography tool that people could use, install and add to with ease. Similar to Metasploit, the project and the team has evolved so much in the little time that it has existed for.

Cryptex itself maturing from Alex's seventeen original Hodge-podge of unoptimized tools, to what is now a professional grade cryptography toolkit. Cryptex is backed by a passionate team of devs ranging from beginners looking for a place to start to advanced devs who want a challenge. We even have a few idea men who come up with whacky encryption ideas for us to try to impliment. (Static Encryption. Go check it out.) Last but 110% not least our sponors who believe in the project enough to financially back us.
Cryptex itself has matured from Alex's hodgepodge of seventeen original but unoptimized tools, to what is now a professional-grade cryptography toolkit. Cryptex is backed by a passionate team of devs, ranging from beginners looking for a place to start, to advanced devs who want a challenge. We even have a few idea men who come up with wacky encryption ideas for us to try to implement. (Static Encryption; go check it out!) Lastly, but definitely not the least, this has been possible thanks to our sponsors who believe in the project enough to financially back us up.

## 🗓️ Upcoming Release
### Cryptex V1.0.0 - Pumpkin Patch 00
After participation in Hacktoberfest 2022 we are going to put the collective updates from the event into a new realease. We are Dubbing the Pumpkin Patch. The plan is every year we do Hacktoberfest we will add a new Pumpkin Patch to Cryptex.

After participation in Hacktoberfest 2022, we are going to put the collective updates from the event into a new release, which we will be dubbing as the Pumpkin Patch. The plan is that for every year we participate in Hacktoberfest, we will add a new Pumpkin Patch to Cryptex.

Other notes:
- We are moving away from the Earth Invader.
- complete rebuild of cryptex to work with Object Oriented Programming.
- Its now easier to implement new Ciphers and tools.
- Installer has been rewritten from the ground up in python.
- Complete rebuild of Cryptex to work with Object-Oriented Programming.
- It is now easier to implement new ciphers and tools.
- Installer has been rewritten from the ground-up in Python.
- The main menu can now dynamically add ciphers and tools to the list.
- We brought back the OG 'Cryptex UI' (We made it look pretty again)
- Implimented a system that lets us use Ascii art for version names.
- We brought back the OG 'Cryptex UI' (we made it look pretty again).
- Implemented a system that lets us use ASCII art for version names.

All of this is pushing Cryptex ever closer to its goal of becoming the `metaploit of cryptography`
All of this is pushing Cryptex ever closer to its goal of becoming the `Metaploit of cryptography`

## [🛠️Basic Help](https://github.com/SSGorg/Cryptex/wiki/Cryptex-Syntax)

## 🖐️ Get in touch
### You can join in on chatting with the dev team on our discord server
### You can join in on chatting with the dev team on our Discord server
<a href="https://discord.gg/899KQFeAXr"><img src="https://discordapp.com/api/guilds/879757204620726362/widget.png?style=banner3" alt="Discord Server"></a>

## 🔧 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](https://github.com/SSGorg/Cryptex/issues) to find out what you could do! but before contrubuting make sure to check out [CONTRIBUTING.md](./CONTRIBUTING.md).
#### **NOTE:** All active development happens in the [beta branch](https://github.com/SSGorg/Cryptex/tree/beta)

Contributions, feedback, and bug reports are welcome! Feel free to check out our [issues page](https://github.com/SSGorg/Cryptex/issues) to find out what you could do! But before contributing, make sure to check out [CONTRIBUTING.md](./CONTRIBUTING.md).

## Our Amazing Contributors🌟

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
qrcode
Cryptography
googletrans==3.0.0
googletrans==3.1.0a0
colorama
pillow
numpy
Expand Down
4 changes: 4 additions & 0 deletions src/cipher/cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ def print_options():
print('''
Not implemented.
''')

def test(args):
raise Exception('Not implemented')
return {'status': False, 'msg': 'Not Implemented'}
34 changes: 21 additions & 13 deletions src/cipher/ciphers/L33T.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,16 @@ class L33T(Cipher): #make sure you change this from text to your cipher
'c': '(',
'e': '3',
'g': '6',
'h': '#',
'i': '¡',
'h': 'H',
'i': '1',
'k': 'X',
'l': '1',
'l': 'l',
'o': '0',
'p': '9',
's': '5',
't': '7',
'x': '*',
'z': '2',
'0': 'O',
'1': 'L',
'2': 'Z',
'3': 'E',
'4': 'A',
'5': 'S',
'6': 'G',
'7': 'T',
'8': 'B',
'9': 'P',
}
inverse_leet_speak = dict((v, k) for k,v in leet_speak.items())

Expand Down Expand Up @@ -76,3 +66,21 @@ def print_options():
python main.py l33t -e -t 'hello'
python main.py l33t -d -t 'h3llo'
''')

def test(args):
total = 2

args.text = 'hello'
expect = 'H3ll0'
out = L33T.encode(args)
if not out['success'] or out['text'] != expect:
return {'status': False, 'msg': f'''Failed to encode "{args.text}"
expected "{expect}" got "{out['text']}"'''}

args.text, expect = expect, args.text
out = L33T.decode(args)
if not out['success'] or out['text'] != expect:
return {'status': False, 'msg': f'''Failed to decode "{args.text}"
expected "{expect}" got "{out['text']}"'''}

return {'status': True, 'msg': f'Ran {total} tests'}
7 changes: 7 additions & 0 deletions src/cipher/ciphers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
from .ma import *
from .bac import *
from .ak import *
from .pf import *
from .affn import *
from .pb import *
from .sha224 import *
from .sha256 import *
from .sha384 import *
from .gc import *
101 changes: 101 additions & 0 deletions src/cipher/ciphers/affn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
"""
Author: Sparsh Gupta | Contributor
Description: Affine Cipher Implementation
"""
from cipher import Cipher
import math

def extended_euclidean_common_devisor(a, b):
if a == 0:
return (b, 0, 1)
else:
gcd, x, y = extended_euclidean_common_devisor(b % a, a)
return (gcd, y - (b // a) * x, x)


def mod_inv(a, m):
gcd, x, _ = extended_euclidean_common_devisor(a, m)
if gcd != 1:
return None # modular inverse does not exist
else:
return x % m

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

name = 'Affine' #change the name
type = 'cipher'


def encode(args):
text = args.text
key_a=args.key_a
key_b=args.key_b

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

if key_a==None :
key_a=1
if key_b==None:
key_b=0


default_dict='abcdefghijklmnopqrstuvwxyz'
m=len(default_dict)

output=''
for char in text:
if(char in default_dict):
x=default_dict.find(char)
e_x=(key_a*x+key_b)%m
output+=default_dict[e_x]
else:
output+=char
return {'text': output, 'success': True}

def decode(args):
text = args.text
key_a=args.key_a
key_b=args.key_b

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

if key_a==None :
key_a=1
if key_b==None:
key_b=0


default_dict='abcdefghijklmnopqrstuvwxyz'
m=len(default_dict)

output=''
for char in text:
if(char in default_dict):
x=default_dict.find(char)
e_x=(mod_inv(key_a,m)*((x-key_b)%m))%m
output+=default_dict[e_x]
else:
output+=char
return {'text': output, '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
-ka / --key_a ------input key -a
-kb / --key_b -------input key -b
### Examples
python main.py text -e -t 'hello' -ka 21 -kb 1
python main.py text -d -t 'hello' -ka 2
Note: Cipher is Case Sensitive. Default Dictionary: abcdefghijklmnopqrstuvwxyz
''')
18 changes: 18 additions & 0 deletions src/cipher/ciphers/b64.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,21 @@ def print_options():
python main.py text -e -t 'hello'
python main.py text -d -t 'hello'
''')

def test(args):
total = 2

args.text = 'hello'
expect = 'aGVsbG8='
out = B64.encode(args)
if not out['success'] or out['text'] != expect:
return {'status': False, 'msg': f'''Failed to encode {args.text}
expected "{args.text}" got "{out['text']}"'''}

args.text, expect = expect, args.text
out = B64.decode(args)
if not out['success'] or out['text'] != expect:
return {'status': False, 'msg': f'''Failed to decode {args.text}
expected "{args.text}" got "{out['text']}"'''}

return {'status': True, 'msg': f'Ran {total} tests'}
20 changes: 20 additions & 0 deletions src/cipher/ciphers/bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,23 @@ def print_options():
python main.py text -e -t 'hello'
python main.py text -d -t 'hello'
''')

def test(args):
total = 2

args.text = 'hello'
expect = '1101000 1100101 1101100 1101100 1101111'
# NOTE (marvhus): Should the binary output have a byte length of 7 or 8?
out = bin.encode(args)
if not out['success'] or out['text'] != expect:
return {'status': False, 'msg': f'''Failed to encode "{args.text}"
expected "{expect}" got "{out['text']}"'''}

args.text, expect = expect, args.text
out = bin.decode(args)
if not out['success'] or out['text'] != expect:
return {'status': False, 'msg': f'''Failed to decode "{args.text}"
expected "{expect}" got "{out['text']}"'''}

return {'status': True, 'msg': f'Ran {total} tests'}

Loading

0 comments on commit b953983

Please sign in to comment.