git.schokokeks.org
Repositories
Help
Report an Issue
webinterface.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
1895bc2
Branches
Tags
master
ticket
webinterface.git
modules
email
include
common.php
SHA-512 auch für E-mail
bernd
commited
1895bc2
at 2010-04-24 11:23:37
common.php
Blame
History
Raw
<?php function encrypt_mail_password($pw) { DEBUG("unencrypted PW: ".$pw); require_once('inc/base.php'); $newpass = ''; if (defined("CRYPT_SHA512") && CRYPT_SHA512 == 1) { $rounds = rand(1000, 5000); $salt = "rounds=".$rounds."$".random_string(8); $newpass = crypt($newpass, "\$6\${$salt}\$"); } else { $salt = random_string(8); $newpass = crypt($newpass, "\$1\${$salt}\$"); } DEBUG("encrypted PW: ".$newpass); return chop($newpass); }