Here's the drill. I've been playing around with my script that reads Internet Explorer Favorites files and processes them through xhtml template file. With the help of some forums (including this one!) i have managed to implement some useful features to it. I'm still seeking one to add and that special one is password protection. I have this idea that .htaccess files are not that good idea after all, or so i've heard. I was thinking using cookie to store an encrypted password on users (that'll be me for now) computer, and checking with the script does it match with password stored on the server. I was thinking just plain text-file with the password encrypted same way as in the cookie. The password would be sent to the perl-script with normal html input-element through POST-method. I know that password then gets sended in plain, readable form, but it's better than nothing for now. This is a code i got from one forum:
my $cleartext = whatever(); my $salt = '$1$'; $salt .= ('A' .. 'Z', 'a'..'z', '0'..'9', '.', '/')[rand 64] for 1..8; my $crypted = crypt $cleartext, $salt; # verifying password my $cleartext = whatever(); my $crypted = getfromdb(); if (crypt($cleartext, $crypted) eq $crypted) { # correct password } else { # incorrect... }
Before i start to dig in to it, i could use some common advices on fact of the matter. And is that above shown code the way to go?

In reply to Securing program executing with Md5-hash by mellin

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.