Greetings monks,

I'm pretty new to perl, but I've just managed to make a 'fully funcional' user/identifier script. The only problem I have left is with the Digest module and after searching long and experimenting hard I don't know what the problem is exactly.

I've bascially got two related calls to md5_hex() in the script: one for registering a new name (ie. turning the pass into a hash) and the second for creating a hash when comparing it against the DB, for logging in.

The problem is that the two separate calls to the function (using the same values of course - and I've checked that so many times...) create different hashes. Not only that, but any changes in the script itself causes the md5 function to create different hashes.

Suprisingly, after submitting a login call, the first hash is different to the hash created after refreshing the page (which is the same for all subsequent refreshes). Now, I've sniffed my packets and I know that both outgoing packets are identical in the information they send... which makes it strange that all refreshes of the login script create the same hash, which is different from the first one.

I can't find an answer anywhere else and with no whiff of help from the actual documentation/source code I have trecked to the mountain. Has anyone got any advice?

Cheers


In reply to Digest md5 scratcher by drrngrvy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.