8/15/2023 0 Comments Xkcd secure password generator::Concat($Prepend, $RandomSymbolWord, $Append) $Append = Get-Random -InputObject $Numbers $Prepend = Get-Random -InputObject $Numbers $NumberedPassword = ForEach ($RandomSymbolWord in $RandomSymbolWords) ::Concat($Prepend, $RandomCaseWord, $Append) $Append = Get-Random -InputObject $Symbols $Prepend = Get-Random -InputObject $Symbols $RandomSymbolWords = ForEach ($RandomCaseWord in $RandomCaseWords) $ChangeCase = Get-Random -InputObject $True,$False ![]() $RandomCaseWords = ForEach ($RandomWord in $RandomWords) $RandomWord = $Dictionary | Select -Index $WordIndex $WordIndex = ($Random.GetBytes($RandomBytes)) $RandomSeed = $Random.GetBytes($RandomBytes) #I don't know why but when the below line is commented out, the function breaks and returns the same words each time. $RandomBytes = New-Object -TypeName 'System.Byte' 4 $MaxWordIndex = Get-Content -Path $DictionaryPath | Measure-Object -Line | Select -Expand Lines $Dictionary = Get-Content -Path $DictionaryPath $DictionaryPath = ('C:\Scripts\Words_' $WordLength '.txt') $RandomWords = ($WordLength in $WordLengths) #PICK WORD FROM DICTIONARY MATCHING RANDOM LENGTHS $WordLength = $MinWordLength $RandomNumber % $WordLength = ($Random.GetBytes($RandomNumber)) $WordLengths = $Words=1 $Words -le $WordCount $Words ) Thanks in advance and let me know if you have any feedback. There is one point of confusion for me here (details on Line 108, if any smart people are curious) basically the whole comment out something and it stops working when it shouldn't thing I hear is common. I have also done some neatening up and miscellaneous cleanup such as implementing /u/BoredComputerGuy's suggestion for the Case Change. You can download an Archive with all of them (which should be extracted to C:\Scripts\) here. I combined everything 24 characters into 24 since there wasn't enough to warrant them being separate. Methodology for splitting the files using PS is at the bottom. This does have the downside of requiring more files, but I think the offset is worth it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |