Ask your own question, for FREE!
Computer Science 7 Online
Aratox:

I'm developing a password strength tester, please tell me how to improve upon it! (I need a lot more to make this actually useful)

Aratox:

Manny300303199:

Nvm I see how it works

Manny300303199:

Well you could maybe make the tester to where the minimum amount of characters is like 6 for it to be strong password

Aratox:

The code that I've incorporated so far goes as follows: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Password Strength Meter</title> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>Password Strength Meter</h1> <input type="password" id="password" placeholder="Enter your password"> <div class="meter"></div> <script src="script.js"></script> </body> </html> ``` ```css body { font-family: Arial, sans-serif; text-align: center; } input { padding: 10px; margin: 20px; border: 2px solid #ccc; border-radius: 5px; } .meter { width: 200px; margin: 0 auto; height: 20px; background-color: #f1f1f1; border-radius: 5px; } .weak { background-color: #ff8080; } .medium { background-color: #ffcc66; } .strong { background-color: #66ff66; } ``` ```javascript const passwordInput = document.getElementById('password'); const meter = document.querySelector('.meter'); passwordInput.addEventListener('input', function() { const password = passwordInput.value; const strength = calculatePasswordStrength(password); // Update the meter color based on password strength if (strength < 4) { meter.className = 'meter weak'; } else if (strength < 8) { meter.className = 'meter medium'; } else { meter.className = 'meter strong'; } }); function calculatePasswordStrength(password) { return password.length; } ```

Aratox:

@manny300303199 wrote:
Well you could maybe make the tester to where the minimum amount of characters is like 6 for it to be strong password
I've actually made it so that the password is required to be at least 8 characters long, although it doesn't check common passwords such as "asdfasdf" or "letmein", etc.

Manny300303199:

@aratox wrote:
@manny300303199 wrote:
Well you could maybe make the tester to where the minimum amount of characters is like 6 for it to be strong password
I've actually made it so that the password is required to be at least 8 characters long, although it doesn't check common passwords such as "asdfasdf" or "letmein", etc.
Oh okay makes sense

Manny300303199:

It's petty good as far as I can tell. Don't know really anything about coding though

Aratox:

@manny300303199 wrote:
It's petty good as far as I can tell. Don't know really anything about coding though
Thanks :) suggestions are always appreciated too

Manny300303199:

@aratox wrote:
@manny300303199 wrote:
It's petty good as far as I can tell. Don't know really anything about coding though
Thanks :) suggestions are always appreciated too
Np mate anytime. I don't see anything wrong with it. But maybe you could make it to where it could tell you if it is poor weak or strong

Manny300303199:

Instead of the color ya no?

Aratox:

@manny300303199 wrote:
@aratox wrote:
@manny300303199 wrote:
It's petty good as far as I can tell. Don't know really anything about coding though
Thanks :) suggestions are always appreciated too
Np mate anytime. I don't see anything wrong with it. But maybe you could make it to where it could tell you if it is poor weak or strong
I can add that, although the colors represent the security of the password for now.

Extrinix:

Different character types, A-Z a-z 0-9 %!@#$^&*()`~-_=+[]{}\|/?><., etc

Aratox:

@extrinix wrote:
Different character types, A-Z a-z 0-9 %!@#$^&*()`~-_=+[]{}\|/?><., etc
Alright, thanks

Extrinix:

It would be a requirements form, basically If it has this, and that, and this other thing, it is secure

Aratox:

@extrinix wrote:
It would be a requirements form, basically If it has this, and that, and this other thing, it is secure
Yep, that's what I figured

Arizona:

cool what is this gonna be used for

Shadow:

I'm gonna type in my QC password rn lmk how good it is

Aratox:

@arizona wrote:
cool what is this gonna be used for
Just testing password strengths, finding weak passwords... I'm basically helping people find secure passwords, and nothing is stored

Extrinix:

Creating strong passwords-?

Aratox:

@shadow wrote:
I'm gonna type in my QC password rn lmk how good it is
Actually don't try that yet lol because it's not even updated

Shadow:

Too late

Arizona:

@shadow wrote:
Too late
why is your password so long how do u remember all that

Extrinix:

Oml

Aratox:

@arizona wrote:
@shadow wrote:
Too late
why is your password so long how do u remember all that
He doesn't, he probably uses a password manager.

astral:

Not a bad start but ideally you would want to implement other conditions that contribute towards a strong password. You can also parse the users input for common phrases if you’d like to experiment with string matching.

Aratox:

@astral wrote:
Not a bad start but ideally you would want to implement other conditions that contribute towards a strong password. You can also parse the users input for common phrases if you’d like to experiment with string matching.
I already have a list of common passwords that I found on NordVPN's website (which has about 200 common passwords listed), and I'm working on finding more common passwords that may compromise account security. Thanks for the tips!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!