A bit of background.
I have SugarCRM. My data for sugarcrm is in a progress database. Apatar can move the data. One problem though. sugarcrm requires a key. I've posted the code below. Apatar is open source, so I grabbed the regular sugarcrm template and created a sugarcrmldap template.
The encryption is where I run into a problem. I've been trying to convert it into java. I know what encryption does, but the coding specifics between ASE/DSE/3DES, i need some help with. Basically, I'm trying to convert the $ldap_hash line into the the same equivalent java code. I can see it's using 3DES, but I've seen some very very different ways of implementing this. I has something going but I was running into an illegal key size. Couldn't figure that out so I'm retreating a bit and looking for help.
$soap_client = new soapclient('http://someurl.com/sugar/soap.php?wsdl');
$user_name = 'matt';
$user_password = 'mygoodsecret123';
$app_name = 'myniceprogram';
$key = 'abc123'; // LDAP Key as entered in Sugar
$key = substr(md5($key),0,24);
$iv = 'password'; // note that this is the word password, not the user's password or hash...
$ldap_hash = bin2hex(mcrypt_cbc(MCRYPT_3DES, $key, $user_password, MCRYPT_ENCRYPT, $iv));
$soap_client->call('login',array('user_auth'=>array('user_name'=>$user_name, 'password'=>$ldap_hash,'version'=>'.1'), 'application_name'=>$app_name));