Skip to content

Instantly share code, notes, and snippets.

@longkey1
Created July 31, 2012 00:59
Show Gist options
  • Save longkey1/3212398 to your computer and use it in GitHub Desktop.
Save longkey1/3212398 to your computer and use it in GitHub Desktop.
Create Security.salt & Security.cipherSeed for CakePHP
<?php
echo 'please input string: ';
$stdin = fgets(STDIN,4096);
// salt
$salt = sha1($stdin);
// seed
$seed = '';
for ($i = 0; $i < 30; $i++) {
$seed .= mt_rand(0, 9);
};
echo "**************************************\n";
echo sprintf("Security.salt: %s\n", $salt);
echo sprintf("Security.cipherSeed: %s\n", $seed);
echo "**************************************";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment