Fixed file uploading, other more minor fixes
This commit is contained in:
@@ -7,11 +7,10 @@
|
||||
<link rel=stylesheet href=style.css type=text/css>
|
||||
</head>
|
||||
<body>
|
||||
<form action=decryptFunc.php method=POST enctype=multipart/form-data>
|
||||
<!--<input type=file name=doc accept=.txt >-->
|
||||
<textarea placeholder="Paste your encrypted file's contents here" name=words></textarea>
|
||||
<input type=text name=key placeholder='Decryption key'>
|
||||
<button type=submit name=submit value=submit id=submitWriting>SUBMIT</button>
|
||||
<form method=POST action=decryptFunc.php enctype="multipart/form-data">
|
||||
<input type=file name=encDoc>
|
||||
<input type=text name=key placeholder='Decryption key'>
|
||||
<button type=submit name=submit value=submit id=submitWriting>SUBMIT</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
require "enc.php";
|
||||
$words = "<encrypted>".$_POST["words"]."</encrypted>";
|
||||
$words = file_get_contents($_FILES["encDoc"]["tmp_name"]);
|
||||
$data = simplexml_load_string($words) or die("Couldn't make object");
|
||||
|
||||
//Get the key
|
||||
|
||||
4
fileUpload.php
Normal file
4
fileUpload.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<form method=POST action=uploaded.php enctype="multipart/form-data">
|
||||
<input type=file name=encDoc>
|
||||
<button type=submit>SUBMIT</button>
|
||||
</form>
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
</script>
|
||||
<form action=submit.php method=POST>
|
||||
<h2 id=counter></h2>
|
||||
<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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
require "enc.php";
|
||||
$enc = encrypt($_POST["words"], $_POST["key"]);
|
||||
$content = '<iv>'.bin2hex($enc[1]).'</iv>'.'<tag>'.bin2hex($enc[2]).'</tag>'.'<content>'.$enc[0]."</content>";
|
||||
$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-Disposition: attachment; filename="encrypted.txt"');
|
||||
|
||||
3
uploaded.php
Normal file
3
uploaded.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
echo file_get_contents($_FILES["encDoc"]["tmp_name"]);
|
||||
?>
|
||||
Reference in New Issue
Block a user