title: Implementing this Java password encryption algorithm in PHP
body: <p>I'm trying to implement a password encryption algorithm used in Funambol mobile sync server in PHP but I'm having hard time as I come from a non-Java background. The code itself seems simple:</p>
  
  <pre><code>encryptionKey   = "Omnia Gallia in tres partes divida est";
  byte[] newValue = new byte[24];
  System.arraycopy(encryptionKey, 0, newValue, 0, 24);
  encryptionKey   = newValue;
  
  KeySpec keySpec             = new DESedeKeySpec(encryptionKey);
  SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESEde");
  Cipher cipher               = Cipher.getInstance("DESEde");    
  SecretKey key               = keyFactory.generateSecret(keySpec);
  
  cipher.init(Cipher.ENCRYPT_MODE, key);
  
  cipherBytes = cipher.doFinal(plainBytes);
  </code></pre>
  
  <p>I'm not necessarily looking for a complete solution, rather pointers on what I can use on PHP's side. Can mcrypt handle this and to what extent? What else do I need? Is this even doable in PHP?</p>
  
  <p>To the curious: I'm building an interface to the Funambol server and I'd like to be able to add users from the interface itself using PHP.</p>