Is a HMAC MD5 hash more secure than a MD5 with a append key?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

Is a HMAC MD5 hash more secure than a MD5 with a append key?

Post by WaldoMonster »

From the example, Is $hash1 more secure than $hash2 ?

Code: Select all

<?php
$data = 'some data to hash';
$key  = 'HjkH&#@ih3IHuugUI#yu6898ljg*WIllO091)2';

$hash1 = bin2hex(mhash(MHASH_MD5, $data, $key));
$hash2 = md5($data . $key);
?>
Post Reply