Author Topic: [AU3][FUNC]Password Generator  (Read 1178 times)

0 Members and 1 Guest are viewing this topic.

Offline B1N4RY2.0

  • /dev/null
  • *
  • Posts: 11
  • Cookies: -3
  • These are not the 1s and 0s you are looking for...
    • View Profile
[AU3][FUNC]Password Generator
« on: July 31, 2015, 03:56:55 am »
Apologies if this is the wrong subforum, only place I found an existing autoit thread ;)
Might come in handy for other n00bs like myself :)

Usage:
Code: [Select]
MsgBox(64, "Results", _pGenerate(16))

Source:
Code: [Select]
#include <String.au3>

Func _pGenerate($sLen)
   Local $aCharset = StringSplit("0123456789!@#$%^&*-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", "")
   Local $sRand = 0, $sDupCheck = 0, $sReturn = ""
   For $i = 1 to $sLen
      $sRand = Round(Random(1, $aCharset[0], 1))
      if $sRand < ($sDupCheck - 8) OR $sRand > ($sDupCheck + 8) Then
         $sReturn = $sReturn & $aCharset[$sRand]
         $sDupCheck = $sRand
      Else
         $i -= 1
      EndIf
   Next

   Return $sReturn

EndFunc ;==> _pGenerate()

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [AU3][FUNC]Password Generator
« Reply #1 on: July 31, 2015, 11:06:14 am »
Dat not random stuff
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline B1N4RY2.0

  • /dev/null
  • *
  • Posts: 11
  • Cookies: -3
  • These are not the 1s and 0s you are looking for...
    • View Profile
Re: [AU3][FUNC]Password Generator
« Reply #2 on: July 31, 2015, 02:23:38 pm »
How so? It picks a random number corresponding to the related array which hold the text characters? Just curious as it seemed to spit out pretty random strings for me :)

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [AU3][FUNC]Password Generator
« Reply #3 on: July 31, 2015, 02:39:19 pm »
How so? It picks a random number corresponding to the related array which hold the text characters? Just curious as it seemed to spit out pretty random strings for me :)
Its about the source of entropy, such random generators are not that random ,just saying.
For passwords this is midly important.
« Last Edit: July 31, 2015, 02:40:08 pm by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline B1N4RY2.0

  • /dev/null
  • *
  • Posts: 11
  • Cookies: -3
  • These are not the 1s and 0s you are looking for...
    • View Profile
Re: [AU3][FUNC]Password Generator
« Reply #4 on: July 31, 2015, 02:43:10 pm »
Ah yes in that aspect no it's not truly random, it does run on a predetermined algorithm to decide it's next "character" :) Was just something simple I wrote quick as an example since the forums seems to be lacking my favorite WinDoze language :D

-edit-
btw Just noticed the name, but if you haven't check out my other (newly) posted source, you may be amused with the original author LOL :D
« Last Edit: July 31, 2015, 02:44:31 pm by B1N4RY2.0 »

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [AU3][FUNC]Password Generator
« Reply #5 on: July 31, 2015, 03:21:35 pm »
Ah yes in that aspect no it's not truly random, it does run on a predetermined algorithm to decide it's next "character" :) Was just something simple I wrote quick as an example since the forums seems to be lacking my favorite WinDoze language :D

-edit-
btw Just noticed the name, but if you haven't check out my other (newly) posted source, you may be amused with the original author LOL :D
I noticed, it is a lotta fun to code something like it and get the results as a reward.
Well done.
:)
« Last Edit: July 31, 2015, 03:22:02 pm by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage