Files
CS-Create/decryptFunc.php
2019-04-09 07:25:07 -04:00

21 lines
454 B
PHP

<?php
require "enc.php";
$words = file_get_contents($_FILES["encDoc"]["tmp_name"]);
$data = simplexml_load_string($words) or die("Couldn't make object");
//Get the key
$key = $_POST["key"];
//Get the IV
$iv = hex2bin($data->iv);
//Get the tag
$tag = hex2bin($data->tag);
//Get the ciphertext
$ciphertext = $data->content;
echo "<pre>Your decrypted content:<br>";
echo decrypt($ciphertext, $key, $iv, $tag);;
?>