<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Ldap backend crypt-des instead of crypt encryption</title> 
  <pubDate>Fri, 10 Apr 2026 02:41:26 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/1998</link> 
  <atom:link rel="self" type="application/rss+xml" title="Ldap backend crypt-des instead of crypt encryption" href="https://bugs.horde.org/ticket/1998/rss" /> 
  <description>Ldap backend crypt-des instead of crypt encryption</description> 
 
   
   
  <item> 
   <title> Hello,



Please excuse my poor english, i will try to expl</title> 
   <description> Hello,



Please excuse my poor english, i will try to explain as precisely as possible



Context : I am using debian/testing for our Academic webmail

it is based on Horde2, IMP3 ... and sork-passwd

Users are authentificated with IMAP and changes are applied in a LDAP backend (Netscape-SUN / iplanet)





Events : Yesterday i decided to upgrade (lots of package including sork-passwd)





Problem raised this morning : users passwd accepted to be changed but users never can login again after passwd change





Problem cause: default encryption is now crypt-des and not crypt as before (no break in case &#039;crypt&#039; instruction in /usr/share/horde2/passwd/lib/Driver.php) and passwd are no more readable in this format



My solution: I have a look to the source php and find some differences with the working version, I made a patch and it is working now. Using crypt-des is a good thing but it should not the default behaviour when using the crypt parameter. I would have like to decide to apply or not.



my working version is Driver.php and Driver.php.deb is the one from the debs



webmail:/usr/share/horde2/passwd/lib# diff -U 7 Driver.php.deb Driver.php

--- Driver.php.deb      2005-05-19 10:59:32.000000000 +0200

+++ Driver.php  2005-05-19 11:09:49.000000000 +0200

@@ -99,14 +99,20 @@

                 }

                 break;

             case &#039;md5-base64&#039;:

                 if ($encrypted == base64_encode(mHash(MHASH_MD5, $plaintext))) {                   return true;

                 }

                break;

             case &#039;crypt&#039;:

+                $encrypted = substr($encrypted, 7);

+                $salt = substr($encrypted , 0, 2);

+                if ($encrypted == crypt($plaintext, $salt)) {

+                    return true;

+                }

+                break;

             case &#039;crypt-des&#039;:

                 $encrypted = preg_replace(&#039;|^{crypt}|&#039;, &#039;&#039;, $encrypted);

                 $salt = substr($encrypted, 0, 2);

                 if ($encrypted == crypt($plaintext, $salt)) {

                     return true;

                 }

                 break;

@@ -166,14 +172,17 @@

         switch ($this-&gt;_params[&#039;encryption&#039;]) {

             case &quot;plain&quot;:

                 break;

             case &quot;sha&quot;:

                 $newPassword = &quot;{SHA}&quot; . base64_encode(mHash(MHASH_SHA1, $newPassword));

                 break;

             case &#039;crypt&#039;:

+               // The salt is left out, generated by php

+               $newPassword = &quot;{crypt}&quot; . crypt($newPassword);

+               break;

             case &#039;crypt-des&#039;:

                 $salt = substr(md5(mt_rand()), 0, 2);

                 $newPassword = crypt($newPassword, $salt);

                 break;

             case &#039;crypt-md5&#039;:

                 $salt = &#039;$1$&#039; . substr(md5(mt_rand()), 0, 8) . &#039;$&#039;;

                 $newPassword = crypt($newPassword, $salt);



Hope it will help,

Anyway, congratulation for your excellent job on this project,





Laurent Le Moine

laurent.le-moine@ac-dijon.fr

Rectorat de l&#039;Académie de Dijon (France)</description> 
   <pubDate>Thu, 19 May 2005 10:02:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1998#t8339</link> 
  </item> 
   
  <item> 
   <title>(maintainer of Debian package speaking)



Drivers.php doesn</title> 
   <description>(maintainer of Debian package speaking)



Drivers.php doesn&#039;t contain any Debian-specific changes in the Debian package. Patch should thus apply cleanly to your version.



Waiting for your comments on the patch to integrate it into the Debian package.</description> 
   <pubDate>Thu, 19 May 2005 12:18:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1998#t8342</link> 
  </item> 
   
  <item> 
   <title>The code is drastically different in CVS. Please see if you </title> 
   <description>The code is drastically different in CVS. Please see if you have the same issue with the current code.</description> 
   <pubDate>Sat, 21 May 2005 04:14:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1998#t8402</link> 
  </item> 
   
  <item> 
   <title>No feedback.</title> 
   <description>No feedback.</description> 
   <pubDate>Mon, 11 Jul 2005 10:15:26 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1998#t9635</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
