Creating a password generator
Creating passwords that are secure can be a bit of a challenge. Some of the best passwords can be generated by a computer. We'll create a program in this recipe that will generate passwords for us.
It is important to note that while it is beyond the scope of this book, the passwords we are creating here with this generator are not of the greatest strength. You can, however, use this as a baseline to create stronger passwords that would be much more challenging to crack.
Getting ready
To get started, open up a new Scratch file. Delete the default sprite and import a button from the Things
folder.
How to do it...
Follow these steps to create our password generator:
Increase the size of the button sprite you just imported to take up a decent amount of space.
Under the Costumes menu for the sprite, click on Edit and add the text Generate to the button.
- Drag a block to the script area.
Create a variable called Password and another called Type.
Create a list called Characters...