Skip to main content

Raymii.org Raymii.org Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed

OpenSSL - Generate Psuedo Random Passwords

Published: 26-07-2013 | Author: Remy van Elst | Text only version of this article


❗ This post is over eleven years old. It may no longer be up to date. Opinions may have changed.

This a snippet to generate a psuedo random password fast via the command line with OpenSSL. It generates a number of random bytes, which can either be output raw, as Base64 or as HEX. The Base64 output is a good password most of the time.

Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:

I'm developing an open source monitoring app called Leaf Node Monitoring, for windows, linux & android. Go check it out!

Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.

You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $200 credit for 60 days. Spend $25 after your credit expires and I'll get $25!

# Base64
openssl rand -base64 NUMBER
# HEX
openssl rand -hex NUMBER

Examples:

openssl rand -base64 48
aqnZUEcnnkQVGaNmKOFBGlx+TScS5WCNaOlNEvTkluw0//g14ZOwTsjBkaDSYSq6

openssl rand -base64 10
c7UxZgREfmN+bQ==

openssl rand -hex 48
8eb0d5eb8a45e4a4ac60b284d317383e91c9d372e3b67b154155c0a1b183c5deb2e5d6dceb6366704828c494951925d5

openssl rand -hex 8
feedfacedeadbeef
Tags: base64 , hex , openssl , password , snippets , ssl