The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need algorithm for password encryption

Discussion in 'cPanel Developers' started by rnr, Nov 3, 2007.

  1. rnr

    rnr Registered

    Joined:
    Nov 3, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I'd like to be able to write a script that automatically assigns a user name and password automatically when a customer buys access to a password-protected folder.

    My passwords are in a file /.htpasswds/public_html/youcan/passwd

    Is there a way to do the following:

    1. Create a user name and password (that part is easy)
    2. Encrypt the password with the same algorithm that cPanel uses
    3. Insert the username and encrypted password into passwds

    What I'm trying to accomplish is to give immediate automatic access to a password set of files in a password-protected directory.
     
  2. philpem

    philpem Member

    Joined:
    Aug 12, 2005
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    If this is a standard htpasswd file, then it'll be encrypted using the Linux/Unix crypt() function.
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    It is a "standard" .htpasswd file :).
     
  4. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    The file supports the standard encryption types... check out htpasswd it will give you some info, you could easily wrap a script around this program.
     
Loading...

Share This Page