t2 en cours

This commit is contained in:
2022-10-14 12:05:34 +02:00
parent bd5367f3be
commit 141fd0f1ef
6 changed files with 119 additions and 72 deletions

View File

@@ -1,3 +1,25 @@
<?php
require('./config.php');
$ret = "";
$deret = "";
if(isset($_POST["Code"]) && $_POST["Code"] != '') {
openssl_public_encrypt($_POST["Code"], $ret, openssl_csr_get_public_key(file_get_contents("./b/requete")));
openssl_private_decrypt($ret,$deret,file_get_contents("./b/clePrivee"));
}
?>
<html>
<form method="POST" action="c.php">
<label for="Code">Texte a chiffrer : </label> <input type="text" name="Code" id="Code" value=""/><br />
<input type="submit" name="Envoyer" value="Envoyer" />
</form>
<p>Texte chiffré : <?php echo $ret?></p>
<p>Texte déchiffré : <?php echo $deret?></p>
</html>