This is a simple and secure password generator written in Odin.
I want to write more Odin, that's all. I've been generating passwords for some time with Ruby or Python core libraries, which is fine, but it seemed a good opportunity to build my own password generator with my new favorite language, write tests, build and deploy an Odin binary in GitHub Actions, and so on.
Recommended.
- Clone this repository.
- Ensure the Odin compiler is installed on your system.
- Build from the root directory.
odin build main -out:mkpw -vet -strict-style -vet-tabs -disallow-do -warnings-as-errorsodin build main -out:mkpw.exe -vet -strict-style -vet-tabs -disallow-do -warnings-as-errors- Download your platform's binary from the most current release.
- Note that on macOS, you'll be informed that the binary cannot be run because it cannot be verified. You can allow the binary to be run anyway, or if that makes you uncomfortable, you can build the application from source.
If you are on macOS or Linux and use Homebrew, you can install from the repository's custom tap.
brew install duffn/mkpw/mkpwYou can also build and run this in the browser.
- Build for the web.
odin build main -target:js_wasm32 -out:web/index.wasm -vet -strict-style -vet-tabs -disallow-do -warnings-as-errors- If you are going to update the CSS, you need to install the Tailwind CSS CLI and compile the CSS.
tailwindcss -i web/mkpw-in.css -o web/mkpw.css --watch- Run a local webserver in the
webdirectory. While you can do this with many languages, it is easy if you have Python.
python -m http.server- Navigate to http://localhost:8000
If on Windows, replease mkpw with mkpw.exe in all the examples below.
- Get help.
mkpw --help
- Generate a password with secure defaults.
mkpw
- Generate 16 passwords, 100 characters each, and don't use numbers or symbols.
mkpw --length=100 --quantity=16 --no-numbers --no-symbols
- Output the password in hex.
mkpw --length=20 --hex
- Output the password in base64.
mkpw --length=20 --base64
- If your concern is, is this program storing your passwords somewhere, the answer is no. If you're a software developer, you can take a look at the code yourself to confirm. There's no server anywhere to even store your passwords. This is running completely as a static site on GitHub.
- If your concern is, is it using a secure method to generate random passwords, the answer is yes. It is using the Odin cryptographic random bytes generator, which generates random bytes suitable for password generation.
MIT