openssl rand -base64 32: My Favorite Way to Make a Strong Password
By Paul Peery · July 7, 2026 · 2 min read

The command that saves my brain
I have a confession. I am bad at making up passwords.
Left on my own, I would type something like "Fluffy2019" and call it a day. My cat would be proud. Hackers would be even more proud.
So I stopped guessing. Now I let my computer do it. One line does the job:
openssl rand -base64 32
Hit enter, and out pops something like a cat walked across the keyboard. But a very smart cat. That mess is a strong, random string, and I love it.
What this thing actually does
Let me break it down in plain words.
opensslis a tool that lives on most Macs and Linux boxes. On Windows you can get it too.randmeans "give me random junk."-base64turns that junk into letters, numbers, and a few symbols so you can copy and paste it.32is how many bytes of random you want.
The result is a long chunk of characters. No dictionary word. No birthday. No cat name. Just pure chaos, which is exactly what you want.
Why I trust it more than my own head
My brain likes patterns. Random is hard for me. I always sneak in something I can remember, and "something I can remember" is also "something a computer can crack."
This command does not care about being cute. It just makes noise that is really hard to guess. That is the whole point.
I use it for:
- API keys and secrets on my sites
- database passwords I never plan to type by hand
- any spot where I need a token and don't want to think
A quick word of warning
Do not use the raw output as a password you have to type every day. You will hate your life. Copy and paste land is where these belong.
Also, once you make one, put it in a password manager or a safe env file. Don't leave it sitting in your terminal history forever like a snack on the counter.
And if you close the window without saving it, it is gone. Poof. The random gods giveth, and the random gods taketh away.
Try it right now
Open your terminal. Paste the line. Watch the magic:
openssl rand -base64 32
Run it a few times just for fun. Every time you get a brand new mess. It never repeats, and it never asks you to remember your cat's name.
Honestly, it is the least glamorous trick I use, and one of the most useful. Simple win.
Comments
No comments yet — be the first!