26 lines
544 B
PHP
26 lines
544 B
PHP
<?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();
|
|
|
|
?>
|