Compare commits

...

25 Commits

Author SHA1 Message Date
ziproot a281212a3f Now correctly mentions Gitea and not Github. 2021-12-02 03:44:44 +00:00
ziproot 2641f69e65 Fix minor typo 2021-11-11 04:52:02 +00:00
ziproot 143e5ea557 Delete 'LICENSE' 2021-10-25 02:42:33 +00:00
ziproot 11a9a606ba Add license
Now it's actually open source.
2021-10-25 02:38:03 +00:00
ziproot ecd7226433 Remove Code of Conduct 2021-10-25 02:35:31 +00:00
PeacefulPotato e17d209ece Update to 1.0.2.1: Clarify more apps that the markdown optimization feature supports 2021-02-09 19:07:53 +00:00
PeacefulPotato b624f8c39b Fix typos 2021-02-09 19:04:55 +00:00
PeacefulPotato e8eafd2cee
Update CONTRIBUTING.md 2020-12-04 15:11:48 -05:00
PeacefulPotato 13b5ed9044
Create pull_request.md 2020-12-04 15:09:30 -05:00
PeacefulPotato 57abbfaac6
Merge pull request #3 from PeacefulPotato/issue-templates
Create issue templates
2020-12-04 15:04:42 -05:00
PeacefulPotato 8a3e27d269 Create issue templates 2020-12-04 15:04:27 -05:00
Peaceful Potato 2a1498f981 Fix .replit file 2020-12-04 19:37:48 +00:00
Peaceful Potato 77a1357e4f Prepare to release HOP 1.0.2 2020-12-04 18:47:12 +00:00
PeacefulPotato 9107971194
Merge pull request #2 from PeacefulPotato/repl
Repl.it integration
2020-12-04 13:34:02 -05:00
PeacefulPotato 28da52cb8e
Create .replit 2020-12-04 13:33:30 -05:00
PeacefulPotato 53e28c7265
Update and rename HOP 1.0.1 - decode.py to HOP 1.0.1.1.py 2020-12-04 13:33:04 -05:00
PeacefulPotato 825799ce0b
Delete HOP 1.0.1 - encode.py 2020-12-04 13:31:36 -05:00
PeacefulPotato 5a59e7fd09
Update CONTRIBUTING.md 2020-12-04 10:28:54 -05:00
PeacefulPotato ed4872fa01
Update CONTRIBUTING.md 2020-12-04 10:19:52 -05:00
PeacefulPotato 7f11e22a5f
Update CONTRIBUTING.md 2020-12-04 10:19:27 -05:00
PeacefulPotato abc36a013c
Create CONTRIBUTING.md 2020-12-04 10:18:02 -05:00
PeacefulPotato 29c56f218d
Update CODE_OF_CONDUCT.md 2020-12-04 09:13:05 -05:00
PeacefulPotato 3fa547f380
Merge pull request #1 from PeacefulPotato/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2020-12-04 09:11:12 -05:00
PeacefulPotato 7a4d13860c
Create CODE_OF_CONDUCT.md 2020-12-04 09:07:05 -05:00
PeacefulPotato f88d5485f4
Create SECURITY.md 2020-12-03 23:12:42 -05:00
10 changed files with 302 additions and 141 deletions

42
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,42 @@
---
name: Bug report
about: Something broke? Let us know here!
title: ''
labels: bug
assignees: ''
---
<!-- PLEASE MAKE SURE YOUR ISSUE DOESN'T ALREADY EXIST! -->
<!-- PLEASE ADD THE SECURITY LABEL IF THE BUG IS SECURITY RELATED! -->
**Issue Description**
A clear and concise description of what the bug is.
**System Details**
* HOP program (such as HOP.1.0.2.py)
* Python version (such as python 3.9)
* Platform name (such as repl.it)
**Steps To Reproduce**
Steps to reproduce the behavior. Should be easy to follow.
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Actual behavior**
A clear and concise description of what actually happened.
**Exception**
```
If the bug is an exception, enter it here.
```
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here

View File

@ -0,0 +1,25 @@
---
name: Feature request
about: Something you don't like? Let us know here!
title: ''
labels: enhancement
assignees: ''
---
<!-- PLEASE MAKE SURE YOUR ISSUE DOESN'T ALREADY EXIST! -->
<!-- PLEASE ASSIGN A RELAVENT LABEL AS DICTATED IN CONTRUBUTING.MD! -->
**Problem**
Something you are missing or do not like about HOP. Be clear and concise.
**Preferred Solution**
Your preferred method of addressing this problem. Be specific. Go into detail on how this solution can be reached.
**Alternate Solutions**
List alternate solutions you considered and why you would rather do your preferred solution.
**Screenshots**
If applicable, add screenshots to help explain your solution.
**Additional context**
Add any other context about the feature request here.

28
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@ -0,0 +1,28 @@
---
name: Question
about: Something you're unsure about? Let us know here!
title: ''
labels: question
assignees: ''
---
<!-- PLEASE MAKE SURE YOUR ISSUE DOESN'T ALREADY EXIST! -->
<!-- ALWAYS TRY TO ANSWER A QUESTION YOURSELF IF POSSIBLE! -->
**Question**
What do you want to know? Be clear and concise.
**Self Research**
Explain what you have already tried to do before asking the question.
**System Details**
* HOP program (such as HOP.1.0.2.py)
* Python version (such as python 3.9)
* Platform name (such as repl.it)
**Screenshots**
If applicable, add screenshots to help explain your question.
**Additional context**
Add any other context about the question here.

View File

@ -0,0 +1,7 @@
<!-- PLEASE BE SURE TO FOLLOW ALL DIRECTIONS IN CONTRIBUTING.MD BEFORE POSTING! -->
**Changes**
A bulleted list of the changes you made. Will be used in release notes.
**Reasoning**
Why you want to make these changes. Should be clear and concise.
**Drawback Handling**
Potential drawbacks in this change and how you addressed them.

2
.replit Normal file
View File

@ -0,0 +1,2 @@
language = "python3"
run = "python3 'HOP 1.0.2.py'"

27
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,27 @@
# Issues
There are three types of issues: Bugs, Questions and Enhancements. For all issues, make sure you aren't posting a duplicate.
## Bugs
Bugs are things that are supposed to work but don't.
Some examples include:
* An error or exception
* A flaw in a security feature
* Encoded messages not decoding properly
Non examples include:
* A security issue not yet advertised (such as adding RSA encrytion)
* Adding something new, instead of fixing something old
* Asking a question about something you don't get
If you find a bug, label it with the "bugs" tag, as well as the "security" tag if the bug relates to security. Then, be sure to label it based on the bug report template.
## Questions
Questions are things that you are unsure about. When in doubt, mark it as a question, though be sure to always answer it yourself before posting. Be sure to format the enhancement as dictated in the feature request template.
## Enhancements
Enhancements are things you want to improve. Be sure to label it based on what type of enhancement it is:
Security: This is an improvement to security you would like to see, such as RSA encryption.
QOL: This is an improvement to quality of life you would like to see, such as more languages as codes. If in doubt, mark it as QOL.
Documentation: This is an improvement to documentation you would like to see.
Be sure to format the enhancement as dictated in the feature request template.
# Pull Requests
Pull requests are when you want to change the code yourself. Please link to any relavent issues by clicking on the gear next to "linked issues".
Additionally, add this to the milestone the issues are linked to, and label it based on what you are trying to solve (Bug or Enhancement and what type if necessary).
They should be formatted as dictated in the pull request template.

View File

@ -1,70 +0,0 @@
#1.0:
#Released HOP Decode
#1.0.1:
#Updated version number to match HOP Encode
#Added changelog
import base64
ciphertext=input("Enter message to decode: ")
steponel = list(ciphertext)
stepone = ""
for i in range(len(steponel)-1):
stepone=stepone+steponel[i]
steptwo = stepone.encode('utf-8')
steptwob = base64.a85decode(steptwo)
steptwoc = steptwob.decode('utf-8')
def vigenere_dec(cipher,key):
alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"
input_string = ""
dec_key = ""
dec_string = ""
dec_key = key
dec_key = dec_key.lower()
input_string = cipher
input_string = input_string.lower()
string_length = len(input_string)
expanded_key = dec_key
expanded_key_length = len(expanded_key)
while expanded_key_length < string_length:
expanded_key = expanded_key + dec_key
expanded_key_length = len(expanded_key)
key_position = 0
for letter in input_string:
if letter in alphabet:
position = alphabet.find(letter)
key_character = expanded_key[key_position]
key_character_position = alphabet.find(key_character)
key_position = key_position + 1
new_position = position - key_character_position
if new_position > 35:
new_position = new_position + 36
new_character = alphabet[new_position]
dec_string = dec_string + new_character
else:
dec_string = dec_string + letter
return(dec_string)
def stepfour(stepthree):
stepthree=str(int(stepthree,36))
test = list(stepthree)
if len(test)%3==1:
stepthree="00"+stepthree
if len(test)%3==2:
stepthree="0"+stepthree
stepthreel = list(stepthree)
stepfourl = [""]*int((float(len(stepthreel))/3))
k = 0
while k < len(stepthreel)-2:
stepfourl[int(k/3)] = stepthreel[k] + stepthreel[k+1] + stepthreel[k+2]
k = k + 3
for j in range(len(stepfourl)):
temp = stepfourl[j]
temp = int(temp)
temp = chr(temp)
stepfourl[j] = temp
stepfour=""
for l in range(len(stepfourl)):
stepfour = stepfour + stepfourl[l]
return(stepfour)
key = input("Enter encryption key: ")
stepthree = vigenere_dec(steptwoc, key)
stepfour = stepfour(stepthree)
print("Your decoded message: "+stepfour)

View File

@ -1,71 +0,0 @@
#1.0:
#Released HOP Encode
#1.0.1:
#Updated version number
#Added optimize for Discord option
#Added changelog
import base64
plaintext = input("Enter message to encode: ")
def b36_encode(i):
if i < 0: return "-" + b36_encode(-i)
if i < 36: return "0123456789abcdefghijklmnopqrstuvwxyz"[i]
return b36_encode(i // 36) + b36_encode(i % 36)
def stepone(plaintext):
magicasciipowers = list(plaintext)
numbersgohere = [""]*len(magicasciipowers)
for i in range(len(magicasciipowers)):
temp = magicasciipowers[i]
temp = ord(temp)
if (temp<100):
numbersgohere[i]="0"+str(temp)
else:
numbersgohere[i]=str(temp)
numbers = ""
for i in range(len(numbersgohere)):
numbers=numbers+numbersgohere[i]
return(int(numbers))
def vigenere_enc(stepone,key):
alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"
input_string = ""
enc_key = ""
enc_string = ""
enc_key = key
enc_key = enc_key.lower()
input_string = stepone
input_string = input_string.lower()
string_length = len(input_string)
expanded_key = enc_key
expanded_key_length = len(expanded_key)
while expanded_key_length < string_length:
expanded_key = expanded_key + enc_key
expanded_key_length = len(expanded_key)
key_position = 0
for letter in input_string:
if letter in alphabet:
position = alphabet.find(letter)
key_character = expanded_key[key_position]
key_character_position = alphabet.find(key_character)
key_position = key_position + 1
new_position = position + key_character_position
if new_position > 35:
new_position = new_position - 36
new_character = alphabet[new_position]
enc_string = enc_string + new_character
else:
enc_string = enc_string + letter
return(enc_string)
key=input("Enter encryption key: ")
steptwo = vigenere_enc(b36_encode(stepone(plaintext)),key)
steptwob = steptwo.encode('utf-8')
stepthree = base64.a85encode(steptwob)
stepthreeb = stepthree.decode('utf-8')
answer = False
while answer == False:
discord = input("Optimize for discord? y or n: ")
if(discord=="y"):
answer = True
stepfour = "```"+str(stepthreeb)+"h```"
elif(discord=="n"):
answer = True
print("Your encoded message: "+stepfour)
stepfour = str(stepthreeb)+"h"

162
HOP 1.0.2.1.py Normal file
View File

@ -0,0 +1,162 @@
#Changelog:
#HOP Encode
#1.0:
#Released HOP Encode
#1.0.1:
#Updated version number
#Added optimize for Discord option
#Added changelog
#HOP Decode
#1.0:
#Released HOP decode
#1.0.1:
#Updated version number to match that of HOP Encode
#Added changelog
#HOP
#1.0.2:
#Combined HOP Encode and HOP Decode
#Integrated GitHub and repl.it
#Added several files, including .replit, CODE_OF_CONDUCT.md, CONTRIBUTING.md, README.md, and SECURITY.md
#Moved input, print, and import statements outside functions
#Added ability to choose on runtime encode or decode
#1.0.2.1:
#Made changes to show that the "optimize for Discord" option also supports Element/Matrix, IRC, Joplin, etc.
import base64
def decode(ciphertext, key):
steponel = list(ciphertext)
stepone = ""
for i in range(len(steponel)-1):
stepone=stepone+steponel[i]
steptwo = stepone.encode('utf-8')
steptwob = base64.a85decode(steptwo)
steptwoc = steptwob.decode('utf-8')
def vigenere_dec(cipher,key):
alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"
input_string = ""
dec_key = ""
dec_string = ""
dec_key = key
dec_key = dec_key.lower()
input_string = cipher
input_string = input_string.lower()
string_length = len(input_string)
expanded_key = dec_key
expanded_key_length = len(expanded_key)
while expanded_key_length < string_length:
expanded_key = expanded_key + dec_key
expanded_key_length = len(expanded_key)
key_position = 0
for letter in input_string:
if letter in alphabet:
position = alphabet.find(letter)
key_character = expanded_key[key_position]
key_character_position = alphabet.find(key_character)
key_position = key_position + 1
new_position = position - key_character_position
if new_position > 35:
new_position = new_position + 36
new_character = alphabet[new_position]
dec_string = dec_string + new_character
else:
dec_string = dec_string + letter
return(dec_string)
def stepfour(stepthree):
stepthree=str(int(stepthree,36))
test = list(stepthree)
if len(test)%3==1:
stepthree="00"+stepthree
if len(test)%3==2:
stepthree="0"+stepthree
stepthreel = list(stepthree)
stepfourl = [""]*int((float(len(stepthreel))/3))
k = 0
while k < len(stepthreel)-2:
stepfourl[int(k/3)] = stepthreel[k] + stepthreel[k+1] + stepthreel[k+2]
k = k + 3
for j in range(len(stepfourl)):
temp = stepfourl[j]
temp = int(temp)
temp = chr(temp)
stepfourl[j] = temp
stepfour=""
for l in range(len(stepfourl)):
stepfour = stepfour + stepfourl[l]
return(stepfour)
stepthree = vigenere_dec(steptwoc, key)
stepfour = stepfour(stepthree)
output = "Your decoded message: "+stepfour
return output;
def encode(plaintext, key):
def b36_encode(i):
if i < 0: return "-" + b36_encode(-i)
if i < 36: return "0123456789abcdefghijklmnopqrstuvwxyz"[i]
return b36_encode(i // 36) + b36_encode(i % 36)
def stepone(plaintext):
magicasciipowers = list(plaintext)
numbersgohere = [""]*len(magicasciipowers)
for i in range(len(magicasciipowers)):
temp = magicasciipowers[i]
temp = ord(temp)
if (temp<100):
numbersgohere[i]="0"+str(temp)
else:
numbersgohere[i]=str(temp)
numbers = ""
for i in range(len(numbersgohere)):
numbers=numbers+numbersgohere[i]
return(int(numbers))
def vigenere_enc(stepone,key):
alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"
input_string = ""
enc_key = ""
enc_string = ""
enc_key = key
enc_key = enc_key.lower()
input_string = stepone
input_string = input_string.lower()
string_length = len(input_string)
expanded_key = enc_key
expanded_key_length = len(expanded_key)
while expanded_key_length < string_length:
expanded_key = expanded_key + enc_key
expanded_key_length = len(expanded_key)
key_position = 0
for letter in input_string:
if letter in alphabet:
position = alphabet.find(letter)
key_character = expanded_key[key_position]
key_character_position = alphabet.find(key_character)
key_position = key_position + 1
new_position = position + key_character_position
if new_position > 35:
new_position = new_position - 36
new_character = alphabet[new_position]
enc_string = enc_string + new_character
else:
enc_string = enc_string + letter
return(enc_string)
steptwo = vigenere_enc(b36_encode(stepone(plaintext)),key)
steptwob = steptwo.encode('utf-8')
stepthree = base64.a85encode(steptwob)
stepthreeb = stepthree.decode('utf-8')
stepfour = str(stepthreeb)+"h"
answer = False
while answer == False:
mdsupport = input("Optimize for markdown supported services, like Discord, Element/Matrix, Joplin, or IRC? y or n: ")
if(mdsupport=="y"):
answer = True
stepfour = "```"+str(stepthreeb)+"h```"
elif(mdsupport=="n"):
answer = True
output="Your encoded message: "+stepfour
return output
var = input("Encode or Decode? 1 for encode, 2 for decode: ")
if (var=="1"):
ciphertext = input("Enter message to encode: ")
key = input("Enter encryption key: ")
print(encode(ciphertext, key))
elif (var=="2"):
plaintext = input("Enter message to decode: ")
key = input("Enter encryption key: ")
print(decode(plaintext, key))

9
SECURITY.md Normal file
View File

@ -0,0 +1,9 @@
# Security Policy
## Supported Versions
Always use the latest version to get the best security. Only the latest version will receive updates.
## Reporting a Vulnerability
Since this is an obsfucation program, if there's some security problem, that's either a bug or an enhancement. Report it using gitea features request and use the security label.