password generation
-
Is there any code for automatic generation of a password. thnaks
-
Is there any code for automatic generation of a password. thnaks
I haven't seen one but it can't be that hard to create a function that takes a random number and returns a char based on the ascii values you allow. I think System.Convert.ToChar(int) is probably the function you need from the top of my head. Russell
-
I haven't seen one but it can't be that hard to create a function that takes a random number and returns a char based on the ascii values you allow. I think System.Convert.ToChar(int) is probably the function you need from the top of my head. Russell
-
arachnoid wrote:
I think System.Convert.ToChar(int) is probably the function you need from the top of my head.
Use it with Math.Random, but you'll end up having a senseless password!!
All generalizations are wrong, including this one! (\ /) (O.o) (><)
i was thinking that that was the critical function rather than using that as the whole algorithm. Then create a wrapper that creates a random number between 0 and 61 and returns an lcase, a ucase or a number with equal probability Russ
-
i was thinking that that was the critical function rather than using that as the whole algorithm. Then create a wrapper that creates a random number between 0 and 61 and returns an lcase, a ucase or a number with equal probability Russ
It is like an automatic generation for an activation code. Maybe my description as a password was some how wronge
-
It is like an automatic generation for an activation code. Maybe my description as a password was some how wronge
use math.random to create a nuber between 0 and 61 use a switch statement for 0 to 25, 26 to 51, 52 to 61 convert the numbers to letters or numbers using system.convert.tochar(int) and these values ^ loop to create a pwd of required length HTH Russ
-
Is there any code for automatic generation of a password. thnaks
-
Is there any code for automatic generation of a password. thnaks
-
Is there any code for automatic generation of a password. thnaks
I think the biggest problem a lot of password generating programs have is that they don't guarantee a strong password. While choosing random characters from a set of predifined values might get you very diversive password, it doesn't mean it always will. So despite using long password, you could still end up with weak ones like 'ifdhgkfsd'. There should be some code to check, if teh generated password meets some special requirements, and possibly do some adjustments. A good example for this is the built-in membership provider for ASP.NET 2.0, which requires you to have at least one non-alphanumerical character in your password. Then again it's not a generator tool, it just checks a given password. I don't mean to stay you need these precautions in every case, however I do mean you should find (or possible write) code that allows usage of similiar features. For example: public string GetPassword(int length, int minUppercaseLetterCount, int minNumberCount, int minNonAlphanumericalCount) { //your code here :) } Obviously, for simple passwords you would use it like GetPassword(5, 0, 0, 0). And if you ever need strong passwords you can still reuse this function. I think this smells like an article :). Someone should write it. Or maybe I will :-D.
-
I think the biggest problem a lot of password generating programs have is that they don't guarantee a strong password. While choosing random characters from a set of predifined values might get you very diversive password, it doesn't mean it always will. So despite using long password, you could still end up with weak ones like 'ifdhgkfsd'. There should be some code to check, if teh generated password meets some special requirements, and possibly do some adjustments. A good example for this is the built-in membership provider for ASP.NET 2.0, which requires you to have at least one non-alphanumerical character in your password. Then again it's not a generator tool, it just checks a given password. I don't mean to stay you need these precautions in every case, however I do mean you should find (or possible write) code that allows usage of similiar features. For example: public string GetPassword(int length, int minUppercaseLetterCount, int minNumberCount, int minNonAlphanumericalCount) { //your code here :) } Obviously, for simple passwords you would use it like GetPassword(5, 0, 0, 0). And if you ever need strong passwords you can still reuse this function. I think this smells like an article :). Someone should write it. Or maybe I will :-D.
it smells like an article but you should add to it some code ;)
szukuro wrote:
I think the biggest problem a lot of password generating programs have is that they don't guarantee a strong password.
i thought about this problem. SO i took the function that GUFFA provided and i am trying to implement it in a way to force it to generate some strong password with at least 2 digits in it.
-
it smells like an article but you should add to it some code ;)
szukuro wrote:
I think the biggest problem a lot of password generating programs have is that they don't guarantee a strong password.
i thought about this problem. SO i took the function that GUFFA provided and i am trying to implement it in a way to force it to generate some strong password with at least 2 digits in it.