diff options
author | thomascube <thomas@roundcube.net> | 2008-05-07 09:38:44 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-05-07 09:38:44 +0000 |
commit | 1854c4525bf1fce227a8cc0fa8aad06615df0eae (patch) | |
tree | 8af3b7c4ebcd34d037337688828f5091c1c39149 /program/include/rcube_config.php | |
parent | eb774cc6eb2818a1bdeae6c316024f93c2533d4e (diff) |
More code cleanup + oop-ization
Diffstat (limited to 'program/include/rcube_config.php')
-rw-r--r-- | program/include/rcube_config.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/program/include/rcube_config.php b/program/include/rcube_config.php index 541767a00..277299f4a 100644 --- a/program/include/rcube_config.php +++ b/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; + } + + } |