1 <?php
 2 /**
 3  * @package     Joomla.Platform
 4  * @subpackage  Crypt
 5  *
 6  * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 7  * @license     GNU General Public License version 2 or later; see LICENSE
 8  */
 9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * Joomla Platform Password Hashing Interface
14  *
15  * @since       12.2
16  * @deprecated  4.0  Use PHP 5.5's native password hashing API
17  */
18 interface JCryptPassword
19 {
20     const BLOWFISH = '$2y$';
21 
22     const JOOMLA = 'Joomla';
23 
24     const PBKDF = '$pbkdf$';
25 
26     const MD5 = '$1$';
27 
28     /**
29      * Creates a password hash
30      *
31      * @param   string  $password  The password to hash.
32      * @param   string  $type      The type of hash. This determines the prefix of the hashing function.
33      *
34      * @return  string  The hashed password.
35      *
36      * @since   12.2
37      * @deprecated  4.0  Use PHP 5.5's native password hashing API
38      */
39     public function create($password, $type = null);
40 
41     /**
42      * Verifies a password hash
43      *
44      * @param   string  $password  The password to verify.
45      * @param   string  $hash      The password hash to check.
46      *
47      * @return  boolean  True if the password is valid, false otherwise.
48      *
49      * @since   12.2
50      * @deprecated  4.0  Use PHP 5.5's native password hashing API
51      */
52     public function verify($password, $hash);
53 
54     /**
55      * Sets a default prefix
56      *
57      * @param   string  $type  The prefix to set as default
58      *
59      * @return  void
60      *
61      * @since   12.3
62      * @deprecated  4.0  Use PHP 5.5's native password hashing API
63      */
64     public function setDefaultType($type);
65 
66     /**
67      * Gets the default type
68      *
69      * @return  void
70      *
71      * @since   12.3
72      * @deprecated  4.0  Use PHP 5.5's native password hashing API
73      */
74     public function getDefaultType();
75 }
76