commit d9c3f306e669c3c94921efdafe56c09737068102 Author: Luke Ogburn <21106956+OakBaron@users.noreply.github.com> Date: Sat Apr 20 17:12:07 2019 -0400 initial commit 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 + + + + + +
+

0

+ + + +
+
+

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 + + + + +

ENCRYPT

+

or

+

DECRYPT

+ + 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; +?>