LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
LinkBack Search this Thread
Old 12-04-2005, 09:20 PM   #1
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Rep: Reputation: 30
md5, SHA and php's mcrypt function


Does anyone know how the php mcrypt function compares to md5 and SHA in terms of being secure?

Using md5 and sha with PHP is a pain because they are 1 way functions(I think).

Has anyone used or know anything about the mcrypt? Also, is it secure enough for sensitive data? I understand while using apache, data in transmit requires -ssl to be secure. Everything i've read makes the mcrypt function sound really nice, but i never see/hear it mentioned with things like md5 and sha. (They could be completely different and I wouldnt understand how really. I'm really just refering to the having the md5 or sha sum vs the mcrypt output. )

Any input is appreciated.
 
Old 12-05-2005, 12:54 AM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 56
They are very different, mcrypt is a library providing an interface to a number of different encryption algorithms. MD5 and SHA-1 are both hashing algorithms which is not the same as encryption.

The basic difference is encryption is two-way, you can hide the data and later you can get it back. This is good for credit card numbers for example as they'll need to be accessible at a later date for processing or verification purposes. Hashing is one-way, once you hash the data you aren't getting it back, ever. This is good for passwords and stuff, one the password is stored you don't need it back ever so hashing is good. If you want to verify that somebody has entered the correct password then just hash their input and compare that, works well.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating MD5 / SHA / SSHA digests from command line? [GOD]Anck Slackware 1 05-19-2005 11:00 AM
ruby equivalent of PHP's print_r(); function?? opioid Programming 1 04-08-2005 01:23 PM
SHA-1 Standard Cracked mikeheggy Linux - Security 8 02-21-2005 05:52 AM
SHA, MD5, LDAP for passwords mastahnke Linux - Security 2 09-25-2003 02:36 AM
PHP's imagecreatefromPNG function Tomasfuego Linux - Software 0 06-20-2003 12:58 AM


All times are GMT -5. The time now is 05:29 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration