Jump to content

PHP Mcrypt: How many people use it?


jack5100nv

Recommended Posts

I am interested in encrypting some text using PHP. I am currently looking at MCrypt Rijndael 256. Example: http://www.w3courses.com/index.php?subaction=showfull&id=1205620312&ucat=12&category=12&catdisplay=PHP

 

I read somewhat about Mcrpyt and found that Mcrypt does not come with PHP, it needs to be installed separately. I am developing a script which i want to destribute to other users. I do not want my script to depend on Mcrypt if it is not widely used. Does anyone know what percentage of Apache servers have Mcrypt? It it safe to use or will my users have problems because of Mcrypt?

Link to comment
Share on other sites

I know dreamhost uses mcrypt. Your best bet here is anywhere you want to use mcrypt, check for it's existence, if it does use mcrypt, if it doesn't, send in plain text or use your own method.

 

if (extension_loaded('mcrypt')) {
    // Do encryption
} else {
    // Plain text
}

 

To avoid possible fatal errors, you could also check if function_exists() as well.

Link to comment
Share on other sites

Thanks. I already have hosting. The problem is that I am going to post the script I am developeing on my site and people can download and install it. I do not want people to turn away just because they don't have Mcrypt. I do not know how many people have MCrypt. Or how many hosting compnies have Mcrypt installed on their servers. Is MCrypt a very widely used script? More than 90%?

Link to comment
Share on other sites

If you're going to ask for help, please pay more attention to the people that try to help you and your initial question.

 

You asked if many servers ran mcrypt. My guess was you were interested mostly in hosting companies. Dreamhost is a very large hosting company, and they do support mcrypt.

 

And I provided you a solution to your problem. If you use my snippet above, your application will run fine without mcrypt, and encrypt the data if they happen to have it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.