1 | <?php |
||
22 | class SiteSecret { |
||
23 | |||
24 | /** |
||
25 | * Initialise the site secret (32 bytes: "z" to indicate format + 186-bit key in Base64 URL). |
||
26 | * |
||
27 | * Used during installation and saves as a datalist. |
||
28 | * |
||
29 | * Note: Old secrets were hex encoded. |
||
30 | * |
||
31 | * @return mixed The site secret hash or false |
||
32 | * @access private |
||
33 | */ |
||
34 | function init() { |
||
43 | |||
44 | /** |
||
45 | * Returns the site secret. |
||
46 | * |
||
47 | * Used to generate difficult to guess hashes for sessions and action tokens. |
||
48 | * |
||
49 | * @param bool $raw If true, a binary key will be returned |
||
50 | * |
||
51 | * @return string Site secret. |
||
52 | * @access private |
||
53 | */ |
||
54 | function get($raw = false) { |
||
78 | |||
79 | /** |
||
80 | * Get the strength of the site secret |
||
81 | * |
||
82 | * If "weak" or "moderate" is returned, this assumes we're running on the same system that created |
||
83 | * the key. |
||
84 | * |
||
85 | * @return string "strong", "moderate", or "weak" |
||
86 | * @access private |
||
87 | */ |
||
88 | function getStrength() { |
||
101 | |||
102 | } |
||
103 |