Skip to content

Commit

Permalink
moved to source folder
Browse files Browse the repository at this point in the history
  • Loading branch information
aahan0511 committed Feb 9, 2025
1 parent bcf5805 commit 71646bb
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 40 deletions.
3 changes: 2 additions & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ There is no data used/processed except for your score, time and block, which is
## Supported Versions

| Version | Supported |
| ------- | ------------------ |
|---------| ------------------ |
| v1.0.0 ||
| v1.0.1 ||
| v1.0.2 ||
| v1.0.3 ||

## Reporting a Vulnerability
Make a new issue for reporting a vulnerability, or make a pull request if you manage to fix it.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__pycache__/
*.pyc
notes.txt
notes.txt
secrypto.egg-info/
dist/
build/
.idea/
7 changes: 4 additions & 3 deletions secrypto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .key import Key
from .cryptograph import encrypt, decrypt
from .source.key import Key
from .source.encrypt import encrypt
from .source.decrypt import decrypt

version = "v1.0.0"
version = "v1.0.3"
28 changes: 1 addition & 27 deletions secrypto/cryptograph.py → secrypto/source/decrypt.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
from .key import Key
from random import shuffle, choice as select

def encrypt(string: str, key: Key | dict[str, list[str]]):
if not string:
return ''

encryption = string

str_order = ["a", "o", "b", "h"]
shuffle(str_order)
str_order = ''.join(str_order)

for char in str_order:
if char == 'a':
encryption = ''.join(str(ord(a)) + select(['¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹']) for a in encryption)
elif char == 'o':
encryption = ''.join(str(oct(ord(a))).replace('0o', '') + select(['9', 'A', 'B', 'C', 'D', 'E', 'F', 'G']) for a in encryption)
elif char == 'b':
encryption = ''.join(str(bin(ord(a))).replace('b', '') + select(['2', '3', '4', '5', '5', '6', '7', '8']) for a in encryption)
elif char == 'h':
encryption = ''.join(str(hex(ord(a))).replace('x', '') + select(['g', 'h', 'i', 'j', 'k', 'l', 'm', 'n']) for a in encryption)

key = key.key if isinstance(key, Key) else key
encryption = ''.join(select(key[a]) for a in encryption + str_order[::-1])

return encryption
from secrypto.source.key import Key

def decrypt(encryption: str, key: Key | dict[str, list[str]]):
if not encryption:
Expand Down
27 changes: 27 additions & 0 deletions secrypto/source/encrypt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from secrypto.source.key import Key
from random import shuffle, choice as select

def encrypt(string: str, key: Key | dict[str, list[str]]):
if not string:
return ''

encryption = string

str_order = ["a", "o", "b", "h"]
shuffle(str_order)
str_order = ''.join(str_order)

for char in str_order:
if char == 'a':
encryption = ''.join(str(ord(a)) + select(['¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹']) for a in encryption)
elif char == 'o':
encryption = ''.join(str(oct(ord(a))).replace('0o', '') + select(['9', 'A', 'B', 'C', 'D', 'E', 'F', 'G']) for a in encryption)
elif char == 'b':
encryption = ''.join(str(bin(ord(a))).replace('b', '') + select(['2', '3', '4', '5', '5', '6', '7', '8']) for a in encryption)
elif char == 'h':
encryption = ''.join(str(hex(ord(a))).replace('x', '') + select(['g', 'h', 'i', 'j', 'k', 'l', 'm', 'n']) for a in encryption)

key = key.key if isinstance(key, Key) else key
encryption = ''.join(select(key[a]) for a in encryption + str_order[::-1])

return encryption
File renamed without changes.
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
long_description = """
<div align="center">
# **`Secrypto`**
# **Secrypto**
**Secrypto** is an excellent cryptographer, with more than $4.5e806$ (**45 with 805 following zeros!**) possible combinations.
---
<br><br>
# **`Contents`**
# **Contents**
</div>
* [**`How To Use`**](#how-to-use)
Expand All @@ -22,7 +22,7 @@
<br><br>
<div align="center">
# **`How To Use`**
# **How To Use**
</div>
Expand Down Expand Up @@ -79,7 +79,7 @@
<br><br>
<div align="center">
# [**`License`**](https://creativecommons.org/publicdomain/zero/1.0/legalcode.en "CC0 1.0 Universal Website")
# [**License**](https://creativecommons.org/publicdomain/zero/1.0/legalcode.en "CC0 1.0 Universal Website")
</div>
Expand All @@ -88,7 +88,7 @@
<br><br>
<div align="center">
# [**`Contributing`**](https://github.com/aahan0511/Secrypto/blob/main/.github/CONTRIBUTING.md "Contributing on Secrypto")
# [**Contributing**](https://github.com/aahan0511/Secrypto/blob/main/.github/CONTRIBUTING.md "Contributing on Secrypto")
</div>
Expand All @@ -97,7 +97,7 @@
<br><br>
<div align="center">
# [**`Code Of Conduct`**](https://www.contributor-covenant.org/ "Contributor Covenant Website")
# [**Code Of Conduct**](https://www.contributor-covenant.org/ "Contributor Covenant Website")
</div>
Expand All @@ -106,7 +106,7 @@
<br><br>
<div align="center">
# [**`Security`**](https://github.com/aahan0511/Secrypto/blob/main/.github/SECURITY.md "Security on Secrypto")
# [**Security**](https://github.com/aahan0511/Secrypto/blob/main/.github/SECURITY.md "Security on Secrypto")
</div>
Expand All @@ -115,7 +115,7 @@

setup(
name='secrypto',
version='1.0.2',
version='1.0.3',
packages=find_packages(),
install_requires=[],
author='Aahan Salecha',
Expand Down

0 comments on commit 71646bb

Please sign in to comment.