+ Reply to Thread
Results 1 to 3 of 3
Like Tree2Likes
  • 2 Post By essellar

Thread: Login script

  1. #1
    kwrat1497 is offline x10Hosting Member kwrat1497 is an unknown quantity at this point
    Join Date
    Dec 2011
    Posts
    3

    Smile Login script

    Does anyone have a good login script i could use? be much appriciated

  2. #2
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: Login script

    You could do a whole lot worse than to use callumacrae's script in this thread.

    Apart from emailing the password to the user (something you can decide upon yourself), it's the right way to go about it. It uses PDO to interact with the database in order to prevent SQL injection, etc. It uses a unique salt per user and PBKDF2 to hash the salted password in a difficult-to-crack way. Above all, it doesn't try to do anything clever -- it uses well-understood and well-tested methods to create just about the best security for login that you can deploy to a PHP-based environment without having extra language modules installed. And it's well-written, clear code, so it's easy to see what's going on (except in PBKDF2 itself, which is also pretty clear once you know a bit about bitwise operations).
    dinomirt96 and karimirt47 like this.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  3. #3
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Login script

    I just noticed another issue: it uses rand for cryptographic purposes, such as nonce generation (note: the statistical problems of rand aren't as obvious on Linux as they are on MS Windows, but they're still there). Under PHP, about the only cryptographically decent pseudo-random generator is openssl_random_pseudo_bytes, though to be truly cryptographically secure, you'd need true random numbers, such as by reading from /dev/urandom (which is available on the X10 servers).
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. login script
    By Chris Z in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-31-2012, 03:15 PM
  2. PHP login script
    By christine19reyes83 in forum Programming Help
    Replies: 5
    Last Post: 02-18-2011, 04:43 PM
  3. php login script
    By matt1213 in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 12-03-2008, 08:31 AM
  4. Login Script
    By taekwondokid42 in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 12-07-2007, 03:49 PM
  5. PHP login script
    By xunhandmex in forum Scripts & 3rd Party Apps
    Replies: 8
    Last Post: 05-26-2005, 07:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers