Announcement

Collapse
No announcement yet.

htpasswd via PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Beorn
    replied
    Something along the lines of this should work.
    PHP Code:
    if(!(file_exists($path_to."/.htpasswd"))) {
    $c " -c";
    }
    $output shell_exec("htpasswd$c $path_to/.htpasswd $username"); 

    Leave a comment:


  • Icheb
    replied
    I'm afraid the same is happening to me. Maybe I should just forget this idea.

    Leave a comment:


  • filburt1
    replied
    Originally posted by Icheb
    I am searching for a method to encrypt passwords with PHP in a way that they can be used in a htpasswd file. Basically all I need is the encryption algorithm which is being used. I don't want to use exec() or so to call the htpasswd program to create the password file, some hosts may have disabled the use of exec().
    BTW, I tried doing this a while ago and never got a hash that worked properly despite reading every user note and link I could find. I just ended up shelling htpasswd itself and reading the output which is definitely going to work.

    Leave a comment:


  • Cyborg from DH
    replied
    good article.

    Leave a comment:


  • NTLDR
    replied
    Take a look here and see if this helps: http://hotwired.lycos.com/webmonkey/...tw=programming

    Leave a comment:


  • Icheb
    replied
    If you compare a password encrypted with crypt() and a password which is stored in a htpasswd file you will see that they don't match at all. I know that htpasswd passwords either use md5() or crypt(), but I can't come close to a working encrypted version with either of them.

    Leave a comment:


  • Cyborg from DH
    replied
    i believe some method using crypt() will give you the result you need.

    Leave a comment:


  • Icheb
    started a topic htpasswd via PHP

    htpasswd via PHP

    I am searching for a method to encrypt passwords with PHP in a way that they can be used in a htpasswd file. Basically all I need is the encryption algorithm which is being used. I don't want to use exec() or so to call the htpasswd program to create the password file, some hosts may have disabled the use of exec().

Related Topics

Collapse

Working...
X