Password Gen

Blitz3D Forums/Blitz3D Beginners Area/Password Gen

MattVonFat(Posted 2004) [#1]
hi, i use this code to generate passwords:

For k = 0 To 8
		abc$ = Rand(1, 4)
	
		Select abc$
			Case 1	
				a% = Rand(65, 90)
				genPass$ = genPass$ + Chr$(a%)
			Case 2
				b% = Rand(97, 122)
				genPass$ = genPass$ + Chr$(b%)
			Case 3
				c% = Rand(0, 9)
				d$ = Str(c%)
				genPass$ = genPass$ + d$
			Case 4
				c% = Rand(0, 9)
				d$ = Str(c%)
				genPass$ = genPass$ + d$
		End Select

Next
	
Notify genPass$


but it keeps coming up as "f113p6258". I cant work out why it does that cause everything looks random to me. :S

Can anyone help?

Thanks


pantsonhead.com(Posted 2004) [#2]
You need to set the randomizer seed for more true random numbers
SeedRnd (MilliSecs())

Read this: http://www.blitzbasic.com/bpdocs/command.php?name=SeedRnd&ref=2d_cat


Agamer(Posted 2004) [#3]
that is true


MattVonFat(Posted 2004) [#4]
ok thanks


Chi3f Stadi(Posted 2004) [#5]
Why don't you use a MD5 hash. I know there is an Md5 algorythm somewhere for Blitz !


darklordz(Posted 2004) [#6]
md5 is user for encrypting not generating....


Chi3f Stadi(Posted 2004) [#7]
i'm happy to see that you're a security specialist.


Agamer(Posted 2004) [#8]
I did last week it is now super fast


darklordz(Posted 2004) [#9]
@Chi3f Stadi>im not realy :P But look the kid is talking about password generation. And if you generate a random string and then encrypt it with the md5 algo that would not be a problem. But if you encrypt the same string the md5 hash would also be the same md5 $. So whats the use. All he wanted was to create something that generates passwords, if after that he chooses to create md5's from those passwords so be it. But that doesnt mean it's better. A good wordlist and a lil john the ripper could easely crack it.... ;)

This is not realy helping the kid issit....


MattVonFat(Posted 2004) [#10]
ok, call me a noob, but what is an Md5?


_PJ_(Posted 2004) [#11]
I guess it's an encryption algorythm ;)


BlackJumper(Posted 2004) [#12]
MD5 is a Message Digest algorithm.... it takes a long string as input (say a few paragraphs) and generates a 'unique' key that cannot be reverse engineered back to the original input.

this ... http://www.faqs.org/rfcs/rfc1321.html ... is a bit techy, but is reasonably definitive.