Skip to content

[MP-144] Website style changes #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8eabe0f
[MP-139] argparse loop
TropicalDjango Apr 5, 2023
c5287b2
[MP-139] multithreading basics
TropicalDjango Apr 5, 2023
56051c3
[MP-139] multithreading fix
TropicalDjango Mar 31, 2023
149a2b9
[MP-144] website file upload, GI encrypt send, and test vector functi…
TropicalDjango Apr 4, 2023
12f5bac
[MP-144] merging with stashes
TropicalDjango Apr 4, 2023
017d691
[MP-144] merging with stashes, adding files in flask
TropicalDjango Apr 4, 2023
5a3aec7
[MP-144] merging with main again
TropicalDjango Apr 5, 2023
5a44469
[MP-144] merging with CLI mutithreading stuff
TropicalDjango Apr 4, 2023
03027a6
[MP-144] merging with CLI mutithreading basics
TropicalDjango Apr 4, 2023
a8d3c60
[MP-144] merging with CLI mutithreading
TropicalDjango Apr 4, 2023
f38272c
[MP-144] merging with stashes
TropicalDjango Apr 4, 2023
9632bc9
[MP-144] trying to connect flask to socket, not going well, can't sen…
TropicalDjango Apr 5, 2023
bc9564f
[MP-144] index, base and style were removed for some reason?
TropicalDjango Apr 5, 2023
05e68c1
[MP-144] website sockets work and Encrypt works, file contents sepera…
TropicalDjango Apr 6, 2023
a44f090
[MP-144] Encryt communications work with files and vectors
TropicalDjango Apr 6, 2023
11f16db
[MP-144] trying out multithreading
TropicalDjango Apr 6, 2023
07e33f9
[MP-144] multithreading works
TropicalDjango Apr 6, 2023
521a83c
[MP-144] end-to-end communication works on website, large amount of d…
TropicalDjango Apr 6, 2023
67cc71f
[MP-144] json error recovery implemented
TropicalDjango Apr 6, 2023
93345f7
[MP-144] minor style edits
TropicalDjango Apr 6, 2023
830d58f
[MP-144] fixed delim style
TropicalDjango Apr 6, 2023
bc1705a
[MP-144] added json error correction to receiving thread
TropicalDjango Apr 6, 2023
ed22dcd
[MP-144] added function to check if user input and decrypted output m…
TropicalDjango Apr 6, 2023
eba763b
[MP-144] all filetypes are acceptted and users can downloaded final p…
TropicalDjango Apr 7, 2023
65aaf51
[MP-144] test vector encoding and regex for client recv api_call fixed
TropicalDjango Apr 7, 2023
dea94ed
[MP-144] CC json fix, times added, encrypt and decrypt funcion sepera…
TropicalDjango Apr 7, 2023
f9bd80e
[MP-144] beginnings of the demo.html page
TropicalDjango Apr 8, 2023
91e8300
[MP-144] demo page fully funtional with times and everything
TropicalDjango Apr 8, 2023
5bd6228
[MP-144] demo page will correctly display newlines
TropicalDjango Apr 8, 2023
114546d
[MP-144] json stirings carry hexadecimal payloads
TropicalDjango Apr 10, 2023
0ee8608
[MP-144] test vector hexadecmial conversion fix
TropicalDjango Apr 10, 2023
d2a1eda
[MP-164] CLI decrypted command (#63)
lwt0000 Apr 8, 2023
9609734
Merge branch 'main' into MP-144
TropicalDjango Apr 10, 2023
8175b20
[MP-144] demo payload hexadecmial conversion
TropicalDjango Apr 10, 2023
e48cf29
[MP-144] Xceed update
TropicalDjango Apr 10, 2023
a7db4fd
[MP-144] dan debugging
TropicalDjango Apr 10, 2023
6aaba87
[MP-144] research page basic html and javascript visibility
TropicalDjango Apr 10, 2023
61f60ae
[MP-144] before regex change and logger messaging in app
TropicalDjango Apr 11, 2023
00b6bcf
[MP-144] regex should work with any json format
TropicalDjango Apr 11, 2023
3c68c54
[MP-144] demo works
TropicalDjango Apr 12, 2023
e623851
[MP-144] file upload works to nodeE
TropicalDjango Apr 12, 2023
f5d3536
[MP-144] research page encrypt works, pre radio removal
TropicalDjango Apr 12, 2023
b6abd7a
[MP-144] research page mostyl done, decrypt doesn't work?
TropicalDjango Apr 12, 2023
3290506
website logo, research page, everything works except multiple vectors
TropicalDjango Apr 13, 2023
8833e14
website redesign and css improvements
TropicalDjango Apr 13, 2023
a9ce502
removed old header logo
TropicalDjango Apr 13, 2023
b81f1d4
removed extra options in calc
TropicalDjango Apr 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@
# Mac/OSX
.DS_Store

# flask pycache
/docs/examples/flask/pycache/
/docs/examples/flask/venv/

/test_framework_package/.idea

# UI test folder
/docs/examples

# flask venv and pycache
# flask venv, pycache, and user uploaded files
/docs/flask/venv/
/docs/flask/__pycache__/
/docs/flask/downloads/
/docs/flask/uploads/

# ccls language server cache
/.ccls-cache/

# pycache for CLI
/CLI/__pycache__/
1 change: 0 additions & 1 deletion CLI/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def to_outgoing_queue(self, message):
# self.outgoing_mutex.release()



def connection_recv(self):
while True:
msg = self.s.recv(4096)
Expand Down
9 changes: 5 additions & 4 deletions CLI/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def UserInput(self) -> bool:
outgoing_t.start()
print("THREAD START")
print_msg_t.start()

print("THREAD START")

# parse the arguments from standard input
while True:
userinput = input("-> ")
Expand Down Expand Up @@ -234,14 +234,15 @@ def UserInput(self) -> bool:




if args.encryption:
# qpp_cipher = QPP_commands.encrypt(test_vectors, "QPP")
# if args.AES:
# aes_cipher = QPP_commands.encrypt(test_vectors, "AES")
print("Send encryption")
#{"api_call":"REQUEST_HANDSHAKE","task_id":"2","interface_type":"T1","sender_id":"1"}\n
task_id += 1
msg = client.string_to_json("ENCRYPT",task_id, "GC", 0, 0, 0, 0, "Hello World")
msg = client.string_to_json("ENCRYPT",task_id, "GC", 0, 0, 0, 5, "Hello")
# client.connection_send(msg)
# client.connection_send('\n')

Expand All @@ -263,7 +264,7 @@ def UserInput(self) -> bool:

#{"api_call":"REQUEST_HANDSHAKE","task_id":"2","interface_type":"T1","sender_id":"1"}\n
task_id += 1
msg = client.string_to_json("DECRYPT",task_id, "GC", 0, 0, 0, 0, "Hello World")
msg = client.string_to_json("DECRYPT",task_id, "GC", 0, 0, 0, 5, "33b492227b33b492bf7133b492bf7133b492bf71")

client.to_outgoing_queue(msg)

Expand All @@ -277,4 +278,4 @@ def UserInput(self) -> bool:

if __name__ == "__main__":
parser = QPP_parser()
parser.UserInput()
parser.UserInput()
Binary file not shown.
97 changes: 97 additions & 0 deletions docs/examples/flask/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
from markupsafe import escape
import os
from flask import Flask, render_template, request, \
url_for, flash, redirect, abort

app = Flask(__name__)
app.config['SECRET_KEY'] = os.urandom(24).hex()
algos = ['AES', 'QPP', 'Both']
tests = ['Encryption', 'Decryption',
'Encrypt & Decrypt', 'M.I.T.M',
'Brute Force', 'Monte Carlo',
'Known Answer', 'Multi-block Message']


@app.route('/index/')
@app.route('/')
def index():
return render_template('index.html')


@app.route('/api/')
def api():
return render_template('api.html')


@app.route('/research/')
def research():
return render_template('research.html')


@app.route('/demo/')
def demo():
return render_template('demo.html')


@app.route('/calc/', methods=['GET', 'POST'])
def calc():
if request.method == 'POST':
test_parameters = [None, None, None, None]
tag = None

test_parameters[0] = request.form.get('num')
test_parameters[1] = request.form.get('len')
test_parameters[2] = request.form.get('algo_select')
test_parameters[3] = request.form.get('test_select')

if request.form.get("log"):
tag += 'l'

if request.form.get("verbose"):
tag += 'v'

data = test_parameters[0]

for i in range(1, 4):
if test_parameters[i] is not None:
data += "+" + test_parameters[i]
return redirect("/view/{}".format(data))
else:
return render_template('calc.html', algos=algos, tests=tests)


@app.route('/view/<int:num>+<int:len>+<algo_type>+<test_type>',
methods=['GET', 'POST'])
def view(num, len, algo_type, test_type):
return render_template('view.html', data=[num, len, algo_type,
test_type])


if __name__ == '__main__':
app.run(debug=True)









@app.route('/capitalize/<word>/')
def capitalize(word):
return "<h3>{}</h3>".format(escape(word.capitalize()))


@app.route('/add/<int:n1>/<int:n2>')
def add(n1, n2):
return "<h1>{}</h1>".format(n1 + n2)


@app.route('/users/<int:user_id>')
def greet_user(user_id):
users = ["Bob", "Kelly", "John"]
try:
return "<h2>Hello {}</h2>".format(users[user_id])
except IndexError:
abort(404)
91 changes: 91 additions & 0 deletions docs/examples/flask/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="./styles/main.css" rel="stylesheet" />
<title>QPP Landing</title>
</head>
<body>
<header>
<!-- Navigation menu -->
<nav>
<ul class="header-list">
<li class="header-logo">
<a href="index.html"> Header Logo </a>
</li>
<li class="header-link">
<a href="./pages/api.html"> API </a>
</li>
<li class="header-link">
<a href="./pages/research.html"> Research </a>
</li>
<li class="header-link">
<a href="./pages/demo.html"> Demo </a>
</li>
<li class="button">
<a href="./pages/cal.html"> Get Started </a>
</li>
</ul>
</nav>
<!-- Header Block -->
<div id="hero">
<div class="hero-text">
<h1 class="hero-title">QPP Testbed</h1>
<p>
Here is some stuff about QPP which is cool. This website was created
in 2023, which is like the future and what not. I'm looking to pad
this with some text to look good.
</p>
<button class="button">Try it</button>
</div>
<div class="hero-image">This is a placeholder</div>
</div>
</header>

<article class="col article-1">
<h2>Some random thingy</h2>
<p>
Phasellus convallis elit id ullamcorper pulvinar. Duis aliquam turpis
mauris, eu ultricies erat malesuada quis. Aliquam dapibus, lacus eget
hendrerit bibendum, urna est aliquam sem, sit amet imperdiet est velit
quis lorem.
</p>
</article>
<div class="side-view">
<article class="col article-2">
<h2>Some random thingy</h2>
<p>
Phasellus convallis elit id ullamcorper pulvinar. Duis aliquam turpis
mauris, eu ultricies erat malesuada quis. Aliquam dapibus, lacus eget
hendrerit bibendum, urna est aliquam sem, sit amet imperdiet est velit
quis lorem.
</p>
</article>

<article class="col article-3">
<h2>Some random thingy</h2>
<p>
Phasellus convallis elit id ullamcorper pulvinar. Duis aliquam turpis
mauris, eu ultricies erat malesuada quis. Aliquam dapibus, lacus eget
hendrerit bibendum, urna est aliquam sem, sit amet imperdiet est velit
quis lorem.
</p>
</article>
</div>
<article class="col article-interim">
<h1>HHHHHHHHHHHHHHH</h1>
<p>oasnfoiasjfniuasjfiasfiuhsafiajsfiusafojsaoijfniosanfo</p>
</article>

<article class="col">
<h1>HSOPCMAOISCM</h1>
<p>
Moloch the incomprehensible prison! Moloch the crossbone soulless
jailhouse and Congress of sorrows! Moloch whose buildings are judgment!
Moloch the vast stone of war! Moloch the stunned governments!
</p>
</article>
</body>
</html>
13 changes: 13 additions & 0 deletions docs/examples/flask/scripts/cal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let myButton = document.querySelector("button");
let myHeading = document.querySelector("h1");
setUserName();

myButton.onclick = () => {
setUserName();
};

function setUserName() {
const myName = prompt("Please enter your name.");
localStorage.setItem("name", myName);
myHeading.textContent = `Your name is ${myName}`;
}
25 changes: 25 additions & 0 deletions docs/examples/flask/scripts/web.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function multiply(num1, num2) {
let result = num1 * num2;
return result;
}

const myHeading = document.querySelector("h1");
const myImage = document.querySelector("img");

myImage.onclick = () => {
const mySrc = myImage.getAttribute("src");
if (mySrc === "images/pic.webp") {
myImage.setAttribute("src", "images/computer.jpg");
} else {
myImage.setAttribute("src", "images/pic.webp");
}
};

myHeading.textContent = "This is a webpage";
multiply(10, 15);

document.querySelector("html").addEventListener("click", () => {
//alert("Ouch! Stop poking me!");
});

// alert("HI");
Loading