From d9c3f306e669c3c94921efdafe56c09737068102 Mon Sep 17 00:00:00 2001
From: Luke Ogburn <21106956+OakBaron@users.noreply.github.com>
Date: Sat, 20 Apr 2019 17:12:07 -0400
Subject: [PATCH] initial commit
---
README.md | 7 +++++++
decrypt.php | 18 ++++++++++++++++
decryptFunc.php | 14 +++++++++++++
enc.php | 17 +++++++++++++++
encrypt.php | 27 ++++++++++++++++++++++++
index.php | 14 +++++++++++++
style.css | 56 +++++++++++++++++++++++++++++++++++++++++++++++++
submit.php | 9 ++++++++
8 files changed, 162 insertions(+)
create mode 100644 README.md
create mode 100644 decrypt.php
create mode 100644 decryptFunc.php
create mode 100644 enc.php
create mode 100644 encrypt.php
create mode 100644 index.php
create mode 100644 style.css
create mode 100644 submit.php
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b33d5d2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,7 @@
+## Encrypt text!
+This repo uses php to encrypt and decrypt text. Encrypted text is
+downloaded into a text file, which stores all relevent information in
+XML.
+To decrypt, upload the file in decrypt.php and type in the encryption
+key. The contents of the txt file are obtained and used along with the
+key to decrypt the original text.
diff --git a/decrypt.php b/decrypt.php
new file mode 100644
index 0000000..190dfbc
--- /dev/null
+++ b/decrypt.php
@@ -0,0 +1,18 @@
+
+
+
+
+ Decrypt file
+
+
+
+
+
+
+ Encrypt a file
+
+
diff --git a/decryptFunc.php b/decryptFunc.php
new file mode 100644
index 0000000..6a9e615
--- /dev/null
+++ b/decryptFunc.php
@@ -0,0 +1,14 @@
+iv);
+ $tag = hex2bin($data->tag);
+ $ciphertext = $data->content;
+
+ echo "Your decrypted content:
";
+ echo decrypt($ciphertext, $key, $iv, $tag);;
+?>
\ No newline at end of file
diff --git a/enc.php b/enc.php
new file mode 100644
index 0000000..60450ed
--- /dev/null
+++ b/enc.php
@@ -0,0 +1,17 @@
+
\ No newline at end of file
diff --git a/encrypt.php b/encrypt.php
new file mode 100644
index 0000000..3cae450
--- /dev/null
+++ b/encrypt.php
@@ -0,0 +1,27 @@
+
+
+
+
+ Encrytion and stuff
+
+
+
+
+
+
+
+ Decrypt a file
+
+
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..81ab08c
--- /dev/null
+++ b/index.php
@@ -0,0 +1,14 @@
+
+
+
+
+ Encrytion and stuff
+
+
+
+
+
+ or
+
+
+
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..fd05d5a
--- /dev/null
+++ b/style.css
@@ -0,0 +1,56 @@
+body{
+ background-color: #151515;
+ color: #ccc;
+ font-size: 1.4em;
+ font-family: monospace;
+}
+a{
+ color: #ccc;
+}
+.center{
+ text-align: center;
+}
+#counter{
+ text-align: center;
+}
+textarea{
+ width: 70%;
+ background-color: #252525;
+ border: none;
+ padding: 1em;
+ border-radius: 0.4em;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ font-size: 0.9em;
+ color: inherit;
+ min-height: 50vh;
+}
+#key{
+ font-family: inherit;
+ display: block;
+ width: 25%;
+ margin-left: auto;
+ margin-right: auto;
+ background-color: #333;
+ border: none;
+ border-radius: 0.4em;
+ padding: 0.5em;
+ margin-top: 1em;
+ font-size: 0.9em;
+ color: inherit;
+}
+button{
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 1em;
+ background-color: #333;
+ color: inherit;
+ border: none;
+ padding: 0.5em 1em;
+ border-radius: 0.4em;
+}
+form>*{
+ margin-top: 1em;
+}
diff --git a/submit.php b/submit.php
new file mode 100644
index 0000000..bd4b3ff
--- /dev/null
+++ b/submit.php
@@ -0,0 +1,9 @@
+\n"." ".bin2hex($enc[1])."\n"." ".bin2hex($enc[2])."\n"." ".$enc[0]."\n"."";
+
+ header('Content-type: text/plain');
+ header('Content-Disposition: attachment; filename="encrypted.txt"');
+ echo $content;
+?>