SignUp/setup/001-generateKey.php

26 lines
544 B
PHP
Raw Normal View History

2019-08-08 13:40:15 +00:00
<?php
/**
* /setup/001-generateKey.php
* @version 1.0
* @desc Generate Crypto key
* @author Fándly Gergő Zoltán
* @copy 2017 Fándly Gergő Zoltán
*/
header("Content-type: text/plain; charset=UTF-8");
require_once("../config/lib/defuse-crypto.phar");
echo "Generating key...\n";
flush();
$key=\Defuse\Crypto\Key::createNewRandomKey();
echo "Key generated!\n";
flush();
echo "Writeing to file...\n";
flush();
file_put_contents("../config/cryptokey.cnf", $key->saveToAsciiSafeString());
echo "Done! Proceed to step 2!";
flush();
?>