I\'m trying to achive the same DES encription that I\'ve in an C# code but in PHP.
The C# code looks like the following:
public static string Encript
Thank you very much guys. Helped me with same problem. PKCS7 padding here: How to add/remove PKCS7 padding from an AES encrypted string? just change ecb to cbc
here is a short snapshot i used:
$key = "29393651";
$iv = $key;
$pass_enc = $mypassword;
$block = mcrypt_get_block_size('des', 'cbc');
$pad = $block - (strlen($pass_enc) % $block);
$pass_enc .= str_repeat(chr($pad), $pad);
$pass_enc = mcrypt_encrypt(MCRYPT_DES, $key, $pass_enc, MCRYPT_MODE_CBC, $iv);
$pass_enc = base64_encode ($pass_enc);