Find Jobs
Hire Freelancers

PHP secure login function(repost2)

$100-500 USD

Cancelled
Posted over 16 years ago

$100-500 USD

Paid on delivery
We need a php function that stores the last date/time a user has logged in and prevents password guessing attacks The function signature is check_password(user's ip address, username, password) The function 1. Does not allow the same ip address to be used for more than 100 different usernames in any given hour. 2. Does not allow a user to have more than 4 wrong (but different) passwords in 1 minute 3. Does not allow the same username to be associated with 10 different ip addresses in 5 minutes. 4. Does not allow concurrent login requests for the same user 5. Does not allow concurrent login requests for the same ip address 6. Returns a list of failed loggin attempts since last login 7. Returns the last successful login and ip address 8. Returns whether subsequent attempts will be delayed. 9. Redirects the user to the same page (with a delay reload). The protections listed above are achieved by just asking the user to wait by 1 minute after 3 wrong passwords and 2 minutes after 10 different passwords, i.,e., protection is *not* acheived by returning a failure. If the user attempts to login when he/she should have waited, the function should fail even if the password was correct. Use sqlite (PDO) to store relevant information. Always salt the passwords with a random value before storing (if you dont understand what "salting" means, this project is not for you). ## Deliverables Two simple test scripts need to be prepared 1. Interactive demo (a simple login page). Display the following text if the user's login fails. Your login credentials are not correct. [You also exceeded <whatever has been exceeded>. You need to wait <60/180> seconds before making another login attempt" This page will <refresh/redirect> in <60/180> seconds.] 2. Regression testing (current requests should be made to demonstrate the correct functioning of the scripts). Examples: Say my username is "han" and password is "pass". Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:01 "han/pass" -> no wait Login from [login to view URL] at 00:02 "han/pass" -> no wait Login from [login to view URL] at 00:05 "han/wrong" -> no wait Login from [login to view URL] at 00:05 "han/wrong" -> no wait Login from [login to view URL] at 00:05 "han/pass" -> no wait Login from [login to view URL] at 00:09 "han/wrong" -> no wait Login from [login to view URL] at 00:09 "han/wrong" -> no wait Login from [login to view URL] at 00:09 "han/wrong" -> no wait Login from [login to view URL] at 00:09 "han/wrong" -> 3 wrong passwords. User has to wait 1 mins (php doesnt. It just returns a 1 min delayed redirect to the webpage) Login from [login to view URL] at 00:13 "han/pass" -> no wait (user waited 1 mins) Login from [login to view URL] at 00:14 "han/wrong" -> no wait Login from [login to view URL] at 00:14 "han/wrong" -> no wait Login from [login to view URL] at 00:14 "han/wrong" -> no wait Login from [login to view URL] at 00:14 "han/wrong" -> user has to wait 1 mins Login from [login to view URL] at 00:14 "han/wrong" -> user didnt wait 1 mins (A 1 min delayed redirect to the webpage) Login from [login to view URL] at 00:14 "han/pass" -> user didnt wait the requested period (login is treated incorrect. a 1 min delayed redirect to the webpage) Login from [login to view URL] at 00:26 "han/pass" -> OK Login from [login to view URL] at 00:30 "han/wrong" -> no wait Login from [login to view URL] at 00:30 "han/wrong" -> no wait Login from [login to view URL] at 00:30 "han/wrong" -> no wait Login from [login to view URL] at 00:30 "han/wrong" -> user has to wait 1 mins Login from [login to view URL] at 00:30 "han/pass" -> user didnt wait 1 mins (login is treated incorrect. a 1 min delayed redirect to the webpage) Login from [login to view URL] at 00:31 "han/wrong" -> user has to wait 1 mins Login from [login to view URL] at 00:31 "han/wrong" -> user has to wait 1 mins Login from [login to view URL] at 00:31 "han/wrong" -> user has to wait 1 mins Login from [login to view URL] at 00:38 "han/wrong" -> user waited but wrong again. user has to wait 1 mins for the next attempt. Login from [login to view URL] at 00:38 "han/pass" -> OK (different IP) Login from [login to view URL] at 00:38 "han/pass" -> Login incorrect. User had to wait 1 mins Login from [login to view URL] at 00:38 "han/pass" -> OK Login from [login to view URL] at 00:38 "han/pass" -> OK Login from [login to view URL] at 00:38 "han/wrong" -> No wait Login from [login to view URL] at 00:39 "han/wrong" -> No wait Login from [login to view URL] at 00:40 "han/wrong" -> No wait ... Login from [login to view URL] at 00:48 "han/wrong" -> No wait (but 10 IP rule triggered). Login from [login to view URL] at 00:49 "han/pass" -> Incorrect. Attack from multiple ips for the same user). Login from [login to view URL] at 00:38 "han01/wrong" -> No wait Login from [login to view URL] at 00:39 "han02/wrong" -> No wait Login from [login to view URL] at 00:48 "han03/wrong" -> No wait ... Login from [login to view URL] at 00:58 "han99/wrong" -> No wait Login from [login to view URL] at 00:58 "han100/wrong" -> No wait Login from [login to view URL] at 00:58 "han/pass" -> Incorrect (a computer is trying to find a login) Also the following ones are OK Same IP/Same time but correct Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait Multple IPs but correct Login from [login to view URL] at 00:00 "han/pass" -> no wait ... Login from [login to view URL] at 00:00 "han/pass" -> no wait Login from [login to view URL] at 00:00 "han/pass" -> no wait ... Login from [login to view URL] at 00:00 "han/pass" -> no wait Same IP but different correct users (probably multiple users behind a NAT) Login from [login to view URL] at 00:00 "han01/pass" -> no wait Login from [login to view URL] at 00:00 "han02/pass" -> no wait ... Login from [login to view URL] at 00:00 "han101/pass" -> no wait 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform PHp 5.x
Project ID: 3307545

About the project

11 proposals
Remote project
Active 16 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
11 freelancers are bidding on average $169 USD for this job
User Avatar
See private message.
$212.50 USD in 18 days
4.9 (308 reviews)
6.8
6.8
User Avatar
See private message.
$425 USD in 18 days
5.0 (4 reviews)
4.7
4.7
User Avatar
See private message.
$161.50 USD in 18 days
5.0 (15 reviews)
4.4
4.4
User Avatar
See private message.
$306 USD in 18 days
4.9 (31 reviews)
4.3
4.3
User Avatar
See private message.
$85 USD in 18 days
5.0 (8 reviews)
3.2
3.2
User Avatar
See private message.
$85 USD in 18 days
4.9 (7 reviews)
2.9
2.9
User Avatar
See private message.
$85 USD in 18 days
4.7 (15 reviews)
2.7
2.7
User Avatar
See private message.
$85 USD in 18 days
0.0 (1 review)
0.0
0.0
User Avatar
See private message.
$246.50 USD in 18 days
0.0 (1 review)
0.0
0.0
User Avatar
See private message.
$85 USD in 18 days
0.0 (2 reviews)
0.0
0.0
User Avatar
See private message.
$85 USD in 18 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
United States
5.0
334
Member since Jan 13, 2007

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.