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.
Hi Max, thank you for the detailed guide! I have a few questions though. Does this method ensure true randomness, or could patterns emerge over time? Also, how does Make.com handle security for sensitive data like passwords? Lastly, can this approach be adapted for longer passwords or specific character exclusions? Looking forward to your insights!
Good question John! As far as I’m aware, it’s truly random and no patterns should emerge over time.
And you can enable “Data is confidential” in your scenario settings if that’s something you’re worried about. Make.com doesn’t keep any logs then, but you have to keep in mind debugging will also be more difficult then in case something goes wrong.
You can change the value in the substring() function to change the length of the password, and you can take characters out before we use the split() function.
Hope that helps! 😄
Interesting guide, Max! Does this method ensure truly random sequences every time? How secure is it against hacking?
Yes, as far as I know, it’s truly random, and with all the characters in it, it should be very safe. You could even choose to generate an even longer password 😄
Really neat guide, Max! Can this method be adapted for longer passwords too?
Yes! In the last step, change the number ’12’ in the substring() function to the length you want 🙂