lib/private/Security/Crypto.php
/**
	 * @param string $message The message to authenticate
	 * @param string $password Password to use (defaults to `secret` in config.php)
	 * @return string Calculated HMAC
	 */
@param string $message The message to authenticate
@param string $password Password to use (defaults to `secret` in config.php)
@return string Calculated HMAC
@param string $message The message to authenticate @param string $password Password to use ( defaults to ` secret ` in config . php ) @return string Calculated HMAC
public function calculateHMAC($message, $password = '') {
		if($password === '') {
			$password = $this->config->getSystemValue('secret');
		}
		$password = hash('sha512', $password . 'a');
		$hash = new Hash('sha512');
		$hash->setKey($password);
		return $hash->hash($message);
	}
public function calculateHMAC ( $ message , $ password = '' ) { if ( $ password === '' ) { $ password = $ this -> config -> getSystemValue ( 'secret' ) ; } $ password = hash ( 'sha512' , $ password . 'a' ) ; $ hash = new Hash ( 'sha512' ) ; $ hash -> setKey ( $ password ) ; return $ hash -> hash ( $ message ) ; }
@param string $message The message to authenticate
 @param string $password Password to use (defaults to `secret` in config.php)
 @return string Calculated HMAC
@param string $message The message to authenticate @param string $password Password to use ( defaults to ` secret ` in config . php ) @return string Calculated HMAC
// Append an "a" behind the password and hash it to prevent reusing the same password as for encryption