26 lines
649 B
PHP
Raw Normal View History

2022-10-07 12:02:36 +02:00
<?php
require('./config.php');
2022-10-14 12:05:34 +02:00
$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>