Tech - Ubuntu/MacOS/Debian - Generate Random (x) Base64 String

Tech - Ubuntu/MacOS/Debian - Generate Random (x) Base64 String

This one is a bit of a quick post.

I found that sometimes I find myself needing something random to use as a key etc..

Using OpenSSL we can create a string of whatever length we like.

Here I did 64.

openssl rand -base64 64 | tr -d '\n' ; echo

Nice and simple, let's do 128!

openssl rand -base64 128 | tr -d '\n' ; echo

You get the point, I didn't need to install or wget anything for this to work using MacOS 14.0 (23A339)

Also here is the same in Debain(Parrot OS)


Tags

#openssl #ubuntu #linux #debain #MacOS #random