in reply to Is this a secure way to prevent cookie tampering
The $secret variable holds a 128 character string, which should be as random as possible.use MD5; my $MAC = MD5->hexhash( $secret. MD5->hexhash(join '', $secret, @fields) );
Update
It looks like the book had a typo as this correct version of the code appears somewhere else in the book.use MD5; my $MAC = MD5->hexhash( $secret. MD5->hexhash(join ':', $secret, @fields) );
jayrom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is this a secure way to prevent cookie tampering
by Anonymous Monk on Jun 30, 2004 at 16:58 UTC | |
by jayrom (Pilgrim) on Jun 30, 2004 at 17:39 UTC |