]>
Commit | Line | Data |
---|---|---|
044cff2d AD |
1 | <?php |
2 | function decrypt_string($str) { | |
3 | $pair = explode(":", $str); | |
4 | ||
5 | if (count($pair) == 2) { | |
6 | @$iv = base64_decode($pair[0]); | |
7 | @$encstr = base64_decode($pair[1]); | |
8 | ||
9 | if ($iv && $encstr) { | |
10 | $key = hash('SHA256', FEED_CRYPT_KEY, true); | |
11 | ||
12 | $str = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $encstr, | |
13 | MCRYPT_MODE_CBC, $iv); | |
14 | ||
15 | if ($str) return rtrim($str); | |
16 | } | |
17 | } | |
18 | ||
19 | return false; | |
ea79a0e0 | 20 | } |