DEV Community

Daniel Marlow
Daniel Marlow

Posted on • Updated on

Lockdown Programming Challenges: 1. Password Strength Indicator

Whether you're just starting programming or are a seasoned pro, the best way to keep your skills up-to-date is to practice.

Over the next few days and weeks I'm going to post a series of programming challenges that you can use to learn a new language, develop your clean coding skills or just while away the hours under lockdown. They will range from simple logic to advanced integrations with external services.

Remember this isn't competition and are there are no prizes, just the knowledge that you have learned something new. Kudos will be earned if your try the challenges in a new programming language or programming style (functional etc) or can write tests to show them working!

Feel free to post links to your code in the comments below and discuss different approaches and what you learned. It would be great to see how you get on.

Stay safe everyone!

Challenge 1. Password Strength Indicator

Create a program that displays the complexity of a given password using the following rules:

  • A weak password contains only letters and has less than 8 characters.
  • A medium strength password contains numbers and letters and has less than 8 characters.
  • A strong password has numbers, letters and these special characters !%:&() and has between 8 and 10 characters.
  • A very strong password has numbers, letters, the special characters !%:&() and has more than 10 characters.

Notes:

Allow the user to input their password and display the password strength on the screen.

Advanced:

Display the password strength as each character is entered by the user.

Top comments (7)

Collapse
 
aminnairi profile image
Amin • Edited

Here is my proposal.

In my opinion, the strength would have been calculated that way:

  • extremely weak: Characters
  • very weak: Characters & digits
  • weak: Characters & digits & upper/lowercase
  • medium: Character & digits & upper/lowercase & special characters
  • strong: Characters & digits & upper/lowercase & special characters & more than 8 characters
  • very strong: Character & digits & upper/lowercase & special characters & more than 10 character
Collapse
 
brahiangarciat profile image
Brahian Garcia

I think it is also important to count the number of bits in the text string, because passwords automatically generated by tools with bit length parameter can have only numbers and letters but are still considered super safe

Collapse
 
drm317 profile image
Daniel Marlow

Feel free to add that as a requirement.

Collapse
 
drm317 profile image
Daniel Marlow

Go for it!

Collapse
 
davic64 profile image
David Victoria

Great, I was looking for challenges to practice what I learned, what a good proposal, congratulations

Collapse
 
jharteaga profile image
Jose Arteaga

Nice challenge, I'm all in!

Collapse
 
drm317 profile image
Daniel Marlow

Awesome! I’d love to see what you come up with. 👍