Make Passwords In PowerShell With DinoPass

If you’ve ever needed a super easy and quick way to generate passwords programatically inside PowerShell, you’ve likely gone down similar rabbit holes to me. I’ve found what I think is the best method, and that’s to make passwords in PowerShell with DinoPass.

Make Passwords In PowerShell With DinoPass

You can also read this on Medium!

What Is DinoPass?

DinoPass is a child friendly way to generate easy to read and remember passwords. You can chose between simple and strong password options as well, and they have a completely free API to generate passwords using PowerShell scripts.

DinoPass was created and is maintained by CodeMoji, an organisation specialising in teaching children the basics of computer programming. They provide specific resources for schools and parents to help their children take their first steps in the world of digital construction.

Why Use DinoPass?

Generating passwords inside computer programs has long been a topic of discussion. There are a ton of security, complexity and convenience factors that come into play.

You could generate a random string of characters, but this often creates passwords that are impossible to remember. Plus the term “random” in the world of computers, doesn’t usually mean completely random as they are often seeded from the current time or CPU cycle.

Make Passwords In PowerShell

When it comes to generating passwords in PowerShell, you have quite a few options. The most basic is Method 1.

Random Characters

The first, worse and oldest method, consists of basically picking a number of random characters and stringing them together:

[string]$initialpassword = ([char[]](Get-Random -input $(47..57 + 65..90 +97..122) -count 8)) + (Get-Random -minimum 0 -maximum 10)

$passwordwithspacesremoved = $initialpassword.Replace(' ','')

$convertedpassword = ConvertTo-SecureString -AsPlainText $passwordwithspacesremoved -Force

As you can see, this is FAR from ideal!

And as mentioned above, random isn’t really a thing computers can do. Computers typically seed these generative methods from the current time or the CPU cycle. I would also like to invite anyone to actually remember these awful passwords…

Web Security Namespace

The second method is to use the built in [System.Web.Security.Membership]::GeneratePassword() function.

What’s great about this function is that it allows you to specify both the password length and the number of alphanumerical characters you need. 

So if I wanted a password that was 10 characters long and included 5 alphanumerical characters, I would use:

Add-Type -AssemblyName 'System.Web'
[System.Web.Security.Membership]::GeneratePassword(10,5)

If I had to chose between method 1 and method 2, I would obviously chose method 2. 

Make Passwords In PowerShell With DinoPass

Now lets move onto the God tier of password generation in PowerShell.

We can leverage the public password generator from DinoPass. The DinoPass generation is amazing, it provides easy to read and remember passwords that are perfect for new users and service accounts.

And you need, is to use the Invoke-WebRequest built into PowerShell. You’ll also need to have an internet connection with access to https://dinopass.com but that’s expected, right?

So if I wanted a secure password from DinoPass, I would use:

Invoke-WebRequest -Uri https://www.dinopass.com/password/strong | Select-Object -ExpandProperty content

As an example, this returns: sh!nyWolf84

You can also use their simple password generator, giving you flexibility in the type of password that is returned:

Invoke-WebRequest -Uri https://www.dinopass.com/password/simple | Select-Object -ExpandProperty content

As an example, this returns: hugefawn22

Conclusion

I hope this has helped someone, using the DinoPass password generator API is still my preferred way of generating passwords inside scripts.

Randomly generating passwords with random characters should never take place in a sane world, the amount of passwords I’ve seen written down on post-it notes because they can’t be remembered makes my heart ache. If a password can’t be remembered, what’s the point?

As a side note, if you can’t remember your password or you have too many to remember I would suggest using BitWarden which offers a completely free password management solutions.

Enjoy! 🎉

4 thoughts on “Make Passwords In PowerShell With DinoPass”

  1. puravive reviews

    Fantastic site A lot of helpful info here Im sending it to some buddies ans additionally sharing in delicious And naturally thanks on your sweat

  2. Fantastic site Lots of helpful information here I am sending it to some friends ans additionally sharing in delicious And of course thanks for your effort

  3. It’s a pity you don’t have a donate button! I’d definitely donate to this superb blog!
    I suppose for now i’ll settle for bookmarking
    and adding your RSS feed to my Google account. I look forward to new updates and will talk about this blog with my Facebook group.
    Talk soon!

Leave a Comment

Your email address will not be published. Required fields are marked *

email popup image
Mark Harwood
NEVER miss a blog post again! Subscribe for email notifications whenever a new post is live!
Subscribe
NEVER miss a blog post again! Subscribe for email notifications whenever a new post is live!
Fill Out This Form, And I Will Be In Touch Shortly
Contact form image
I'll Be In Touch Soon