diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-05-07 09:38:44 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-05-07 09:38:44 +0000 |
| commit | b45dc036d214d3cfb0f320921f510f6b85c9fdac (patch) | |
| tree | 12abf256bccef3e795a80023d163f18c4c253392 /roundcubemail/program/include/rcube_config.php | |
| parent | ab80b06250eb55781e96d70d6b52622c073ca13f (diff) | |
More code cleanup + oop-ization
git-svn-id: https://svn.roundcube.net/trunk@1360 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_config.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_config.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_config.php b/roundcubemail/program/include/rcube_config.php index 541767a00..277299f4a 100644 --- a/roundcubemail/program/include/rcube_config.php +++ b/roundcubemail/program/include/rcube_config.php @@ -148,5 +148,26 @@ class rcube_config return $this->prop; } + + /** + * Return a 24 byte key for the DES encryption + * + * @return string DES encryption key + */ + public function get_des_key() + { + $key = !empty($this->prop['des_key']) ? $this->prop['des_key'] : 'rcmail?24BitPwDkeyF**ECB'; + $len = strlen($key); + + // make sure the key is exactly 24 chars long + if ($len<24) + $key .= str_repeat('_', 24-$len); + else if ($len>24) + substr($key, 0, 24); + + return $key; + } + + } |
