Tuesday, October 16, 2012

Encryption Functions in PHP: crypt() and md5()

Hi! In this article, I am going to share encryption functions on PHP programming language with you. Well, there are several functions about this subject, but here the point is crypt and md5.


md5 function is a text encryption. Here the text or string may be probably as password. md5 function makes the text a value which is 32-digit. Sure this value is probably going to be more complex than older text value.
print md5("phpservisi.com");
md5 function's output
The example given above shows us phpservisi.com string value's output with md5 function.

crypt function is the same mission with md5. Namely this is encryption function too. Here the variety is complexity of output. Because of it is some of us use this one, like me :) 

One more feature is the output of crypt function's about making one-way string hashing. crypt function will return a hashed string using alternative algorithms that may be available on the system.

Now, I'm coding about this:


echo crypt("phpservisi.com"); 
echo "\n".crypt("phpservisi.com"); 
echo "\n".crypt("phpservisi.com"); 
echo "\n".crypt("phpservisi.com"); 
echo "\n".crypt("phpservisi.com"); 
echo "\n".crypt("phpservisi.com"); 
echo "\n".crypt("phpservisi.com"); 
echo "\n".crypt("phpservisi.com");

crypt function's output
As you've seen on the top is crypt function's output. I did the same thing 8 times, and crypt function has just given us different results about those.

If you want to learn more information about this subject, you can visit the PHP Manual web page: md5cryptsha1_filecrc32sha1hash

3 comments:

  1. I was curious if you ever considered changing the structure of your website?
    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having one or two
    pictures. Maybe you could space it out better?

    Also visit my weblog boston immigration lawyer ()

    ReplyDelete

Thanks