Added links, added CSS
This commit is contained in:
12
decrypt.php
12
decrypt.php
@@ -7,10 +7,12 @@
|
|||||||
<link rel=stylesheet href=style.css type=text/css>
|
<link rel=stylesheet href=style.css type=text/css>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form method=POST action=decryptFunc.php enctype="multipart/form-data">
|
<form class=center method=POST action=decryptFunc.php enctype="multipart/form-data">
|
||||||
<input type=file name=encDoc>
|
<input type=file name=encDoc><br>
|
||||||
<input type=text name=key placeholder='Decryption key'>
|
<input id=key type=text name=key placeholder='Decryption key'><br>
|
||||||
<button type=submit name=submit value=submit id=submitWriting>SUBMIT</button>
|
<button type=submit name=submit value=submit id=submitWriting>SUBMIT</button>
|
||||||
</form>
|
</form>
|
||||||
|
<br>
|
||||||
|
<p class=center><a href=/cs/encrypt.php>Encrypt a file</a></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
27
encrypt.php
Normal file
27
encrypt.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset=utf-8>
|
||||||
|
<title>Encrytion and stuff</title>
|
||||||
|
<meta name=viewport content=width=device-width,initial-scale=1.0>
|
||||||
|
<link rel=stylesheet href=style.css type=text/css>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
function wordCount(thing) {
|
||||||
|
regex = /(\S\s)|(([A-Z]|[a-z])(\.|\!|\?|\z))/;
|
||||||
|
numOfParenthesis = 5; //how many par. sets are in the regex
|
||||||
|
words = (thing.value.split(regex).length-1)/numOfParenthesis;
|
||||||
|
document.getElementById("counter").innerHTML = words;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<form action=submit.php method=POST>
|
||||||
|
<h2 id=counter>0</h2>
|
||||||
|
<textarea onkeyup=wordCount(this) placeholder='Write your words here...' name=words></textarea>
|
||||||
|
<input id=key type=text name=key placeholder='Decryption key' required>
|
||||||
|
<button type=submit name=submit value=submit id=submitWriting>SUBMIT</button>
|
||||||
|
</form>
|
||||||
|
<br>
|
||||||
|
<p class=center><a href=/cs/decrypt.php>Decrypt a file</a></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
21
index.php
21
index.php
@@ -6,20 +6,9 @@
|
|||||||
<meta name=viewport content=width=device-width,initial-scale=1.0>
|
<meta name=viewport content=width=device-width,initial-scale=1.0>
|
||||||
<link rel=stylesheet href=style.css type=text/css>
|
<link rel=stylesheet href=style.css type=text/css>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body class=center>
|
||||||
<script>
|
<h2><a href=encrypt.php>ENCRYPT</a></h2>
|
||||||
function wordCount(thing) {
|
<p>or</p>
|
||||||
regex = /(\S\s)|(([A-Z]|[a-z])(\.|\!|\?|\z))/;
|
<h2><a href=decrypt.php>DECRYPT</a></h2>
|
||||||
numOfParenthesis = 5; //how many par. sets are in the regex
|
|
||||||
words = (thing.value.split(regex).length-1)/numOfParenthesis;
|
|
||||||
document.getElementById("counter").innerHTML = words;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<form action=submit.php method=POST>
|
|
||||||
<h2 id=counter>0</h2>
|
|
||||||
<textarea onkeyup=wordCount(this) placeholder='Write your words here...' name=words></textarea>
|
|
||||||
<input type=text name=key placeholder='Decryption key'>
|
|
||||||
<button type=submit name=submit value=submit id=submitWriting>SUBMIT</button>
|
|
||||||
</form>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
56
style.css
Normal file
56
style.css
Normal file
@@ -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;
|
||||||
|
}
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
require "enc.php";
|
require "enc.php";
|
||||||
$enc = encrypt($_POST["words"], $_POST["key"]);
|
$enc = encrypt($_POST["words"], $_POST["key"]);
|
||||||
$content = "<encrypted>\n"." <iv>".bin2hex($enc[1])."</iv>\n"." <tag>".bin2hex($enc[2])."</tag>\n"." <content>".$enc[0]."</content>\n"."</encrypted>";
|
$content = "<encrypted>\n"." <iv>".bin2hex($enc[1])."</iv>\n"." <tag>".bin2hex($enc[2])."</tag>\n"." <content>".$enc[0]."</content>\n"."</encrypted>";
|
||||||
|
|
||||||
header('Content-type: text/plain');
|
header('Content-type: text/plain');
|
||||||
header('Content-Disposition: attachment; filename="encrypted.txt"');
|
header('Content-Disposition: attachment; filename="encrypted.txt"');
|
||||||
echo $content;
|
echo $content;
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user