Results 1 to 7 of 7

Thread: .htpasswd password encryption script

  1. #1
    Join Date
    Jan 2005
    Location
    Cardiff
    Posts
    449
    Thanks
    10
    Thanked 17 Times in 17 Posts

    Default .htpasswd password encryption script

    A while back I wrote an online .htpasswd & .htaccess editor for a client who doesn't have access to Helm.

    It worked OK with URL Protector, but under IIS Pasword, the passwords are encrypted.

    Does anyone know of a script that will produce the user:encrypted password pairs for me from an entered username and password?

    There are stacks of online password generators around but I want one that I can run on my site.

    Cheers,

    Mark

  2. #2
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    I do actually mean to upgrade to URLProtector, we have licences - we just have a problem in that we can't decrypt the current passwords to make them URLPortector compatible.

    Anyway, the encryption routine that you are looking for is CRYPT - a standard implemetion of CRYPT should get you the result you need.

    I think you will find a couple of ASP/PHP scripts which implement CRYPT.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  3. #3
    Join Date
    Jan 2005
    Location
    Cardiff
    Posts
    449
    Thanks
    10
    Thanked 17 Times in 17 Posts

    Default

    OK thanks Warren - I'll have a Google

    Re: upgrading to URL Protector - it's not just that the passwords are encrypted, aren't the three files named differently too?

  4. #4
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Yes, but I can easilly write a script to convert filenames and file content etc... just I cant decrypt the passwords because CRYPT is one-way like MD5
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  5. #5
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    PHP Script (easy):

    PHP Code:
    <?
    $password 
    crypt("password");
    ?>
    ASP Script:
    Didnt find anything, but you could use MSXML2 to read the value of a PHP script output - if you need this let me know and Ill put the code together for you.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  6. #6
    Join Date
    Jan 2005
    Location
    Cardiff
    Posts
    449
    Thanks
    10
    Thanked 17 Times in 17 Posts

    Default

    Quote Originally Posted by Warren Ashcroft
    PHP Script (easy)
    Yep - didn't relise quite how easy!
    I used PHP and a form with user & pass fields

    PHP Code:
    <?php
    if (isset($_POST[user]) && isset($_POST[pass]))
    {
    $user $_POST[user];
    $pass $_POST[pass];
    $htpasswd_text $user.":".crypt($pass,CRYPT_STD_DES);
    echo 
    $htpasswd_text;
    }
    ?>
    Last edited by Mark Voss; 21st June 2005 at 05:43 PM.

  7. #7
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    No problem
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP: Pronounceable password generator
    By nick in forum Code Sharing
    Replies: 2
    Last Post: 16th February 2006, 01:21 PM
  2. Any password reset problem?
    By soul in forum Sales and Service Feature Enquiries
    Replies: 6
    Last Post: 24th December 2005, 04:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •