Is mcrypt installed by default


#1

I have searched the forums here and because of the results dealing with old php versions, upgrades, etc. I am unclear.

Does the current version of PHP used in our Dreamhost accounts by default have mcrypt enabled or does a custom version of PHP need to be compiled?

If it needs to be compiled, is there a list of trusted/approved coders who could be hired to do this for Dreamhost users. I know directions are posted in the wiki but it looks way too complicated for the average “weekend” webmaster to tackle!

Thank you!


#2

Judging by phpinfo(), yes:

mcrypt

mcrypt support enabled
Version 2.5.7
Api No 20021217
Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream

Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value

-Scott


#3

If you want to test your environment, save this as test.php, upload and browse to it.

<?php $key = 'secret key'; $plain_text = 'secret data'; $td = mcrypt_module_open('des', '', 'ecb', ''); $key = substr($key, 0, mcrypt_enc_get_key_size($td)); $iv_size = mcrypt_enc_get_iv_size($td); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); if (mcrypt_generic_init($td, $key, $iv) != -1) { $c_t = mcrypt_generic($td, $plain_text); mcrypt_generic_deinit($td); mcrypt_generic_init($td, $key, $iv); $p_t = mdecrypt_generic($td, $c_t); mcrypt_generic_deinit($td); mcrypt_module_close($td); echo $plain_text," -> encrypted to -> ",$c_t," -> decrypted to -> ", $p_t; } if (!strncmp($p_t, $plain_text, strlen($plain_text)) == 0) { echo "error\n"; } ?>
Maximum Cash Discount on any plan with MAXCASH