-
20
Jun
Due to increased security policies, most of us are required to change the passwords almost every month and you can’t use your 5 previous passwords. Here is a useful Matlab code to simulate a password that contains, numbers, letters and special characters. You can save the file as makePass.m or remove the function line and execute without function mode. Enjoy.
function pass=makePass;
pool={'1','2','3','4','5','6','7','8','9','0','a','b','c','d','e','f','g','h',...
'i','j','k','l','m','n','o','p','r','s','t','u','v','w','y','z','!','@','#','$','%','^','&','*'};
aa=ceil(rand(1,8)*42);
pass=[pool{aa(1)} pool{aa(2)} pool{aa(3)} pool{aa(4)} pool{aa(5)} pool{aa(6)} pool{aa(7)} pool{aa(8)}];
Related Posts
- Published by CleanPC.org in: Computer Safety Computer Tips
- If you like this blog please take a second from your precious time and subscribe to my rss feed!
2 Responses to “How to create complex passwords in Matlab”
Please help me how to make a Automatic Tiller Machine (ATM) with 4 to 6 digits password using MATLAB.
Thank You…
Hi Mark,
Making password for ATM machines is easier. First, create the indices:
pool={’1′,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9′};
Second , define the number of the digit you want to simulate:
For 4 digit passwords:
aa=ceil(rand(1,4)*9);
pass=[pool{aa(1)} pool{aa(2)} pool{aa(3)} pool{aa(4)}];
For 6 digit passwords:
aa=ceil(rand(1,6)*9);
pass=[pool{aa(1)} pool{aa(2)} pool{aa(3)} pool{aa(4)} pool{aa(5)} pool{aa(6)}];
Notice that I didnt include ’0′ among the numbers to be simulated. Most passwords (pins) inn ATM machines dont have ’0′ but you can include as you like. If you include it, you need to change 9 to 10 in aa variable. Regards.
Leave a Reply