Sometimes you need to create accounts, and have to set the password yourself.
In this short guide, I’ll show you how you can easily generate a secure random password within your scenario.
What we’re going to do
It’s possible to create a random number by multiplying the random math variable and rounding it up;
round(random*1000000000000)
= 231331208458
But this is not very strong.
We need to create a secure password that consists of:
- Uppercase letters:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
- Lowercase letters:
abcdefghijklmnopqrstuvwxyz
- Numbers:
0123456789
- Special characters:
!@#$%^&*
To do that, we’re going to use the array functions.
(sounds more complicated than it is, pinky promise)
We will first separate each character into it’s own array, shuffle them, put them back together, and get the first 12 characters which is going to be our password.
Let me show you 🤓
How to generate a strong random password
First, we are going to use the split()
function to split all possible password characters into their own array.
We split it by emptystring
because there are no separators between the characters.
split(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*;emptystring)
Then, we’re going to shuffle the newly created array;
shuffle(​split(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*;emptystring)​)
Now we have a randomly shuffled array with all the characters.
To turn the array back into a text, we use the join()
function.
join(​shuffle(​split(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*;emptystring)​)​)
= T89yv#IifpSqOnN*htVosF@!ZJckP5BDH$zKL7eUm0Q3RG2YwrdWg461CbuxMa%Al#&jXE
And finally, we use the substring()
function to get only the first 12 characters of this random text.
substring(​join(​shuffle(​split(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*;emptystring)​)​)0;12)
= T89yv#IifpSq
Change the number 12 to another number if you want a longer or shorter password.
And that’s it!
Everytime the scenario runs, it will create a strong random password.
You can paste the code below into a field in Make.com if you don’t want to recreate the whole formula by hand:
{{substring(join(shuffle(split("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; emptystring)); emptystring); 0; 12)}}
Conclusion
This is a simple way to generate a secure random password.
I especially like it because you don’t need any extra modules that cost operations to run, you can just directly insert the formula in a field where you need it.
Happy automating! 🤓
Is this method really secure enough for all types of accounts or just basic ones?
I would say it’s fine for any kind of account. You might consider making the password longer so it’s stronger.