Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Mass Password Generation Function

$
0
0
Hello guys :).

So I have been trying to make a function that will create an array of random passwords and also allows the user to select how much passwords they want to be generated and the length of each of those passwords. It was coming along quite smoothly for the most part however I have hit a wall in my progress and I am a bit stuck. When the final array is displayed because of the way in which I have coded it half of the arrays are empty and the rest are the generated passwords. I believe this is because I declare my array with x amount of values but don't add values until later on. My original logic was that I was going to declare the array and assumed it would be completely empty until I defined the values at a later stage but this is not the case and if I try to define the values and they are not listed directly under the array I will of course get a syntax error. I really am not sure how to proceed hope someone can help.

Sorry if you don't understand my explanation I am having trouble finding the right words to describe the issue.
Please note I will likely never use this function in the future however decided to make it out of practice so if there is anyone with a more urgent issue then just ignore this post for now :).

[ autoit ]         
#include <Array.au3> PassGen(10,10) Func PassGen($i_PWlength, $i_GenCount) ;Variable contains most keys with the exception of some special characters. $Keys = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z," $Keys &= "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z," $Keys &= "0,1,2,3,4,5,6,7,8,9," $Keys &= "`,!,£,$,%,^,&,*,(,),-,_,=,+,{,[,},],;,@,~,#,?,<,>,/,\" $KeyValue = StringSplit($Keys, ",", 0) $CurrentPW = "" Local $PWLog[$i_GenCount] For $i_1 = 0 to $i_GenCount Step 1 For $i_2 = 0 to $i_PWlength Step 1 $CurrentPW = $CurrentPW & $KeyValue[Random(0, $KeyValue[0])] Next _ArrayAdd($PWLog, $CurrentPW) $CurrentPW = "" Next _ArrayDisplay($PWLog, "Password Log") EndFunc ;==>PassGen

Forum removed my tabbing >_<

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>