Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I have a password textboxfor field in my page. I need to implement "Avoiding dictionary words in the password textbox" using C# MVC. How this can be implemented ?

What I have tried:

I have no idea how to implement . any ideas would be appreciated
Posted
Updated 31-Jul-23 12:22pm
v2
Comments
Philippe Mori 24-Nov-16 10:20am    
Just require that the user enter at least one digit or special character and you would never have any word that is in the dictionary.

Get a text file that has every word in the dictionary in it. When someone creates an account check their password against each and every line of the text file to see if it exists in it. It's fairly straight-forward so I'm unsure what your specific issue is.
 
Share this answer
 
Comments
Sougandika Sagar 26-Nov-16 10:09am    
Hey thanks for your idea ! what i need is can we do some integration with google API or something ? because can we put all the dictionary words in one text file ? and if some updates are done we should manually update them, this becomes cumbersome. We have some long running projects so need some strong approach.
Just create a list of words (a dictionary) that contains the words that are not allowed and check if the entered password exists in the list.

The list can be hard coded in your program (e.g. array of strings), loaded from a file (e.g. a text file), or stored in a database.

Because checking should be probably case-insensitive, create the list with all words lower-case or upper-case and convert the input accordingly before iterating over the list and comparing.
 
Share this answer
 
Comments
Sougandika Sagar 26-Nov-16 10:10am    
Hey thanks for your idea ! what i need is can we do some integration with google API or something ? because can we put all the dictionary words in one text file ? and if some updates are done we should manually update them, this becomes cumbersome. We have some long running projects so need some strong approach.
F-ES Sitecore 28-Nov-16 4:04am    
There are dictionary lists out there already, quite a few of them. I suppose there is probably a dictionary API out there too that you could use but it wouldn't be as reliable as having a text file.
Jochen Arndt 28-Nov-16 4:18am    
If you use a text file you have to write a function that loads it into memory.

So just write an application to add and remove words. This requires only an input field, a function to write the file, and for removing a function to move list items.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900