Skip to content

Instantly share code, notes, and snippets.

@andrewh
Last active August 9, 2022 21:53
Show Gist options
  • Save andrewh/6475068 to your computer and use it in GitHub Desktop.
Save andrewh/6475068 to your computer and use it in GitHub Desktop.
Password generator using a quantum random number generator
#!/usr/bin/env ruby
# qpasswd - password generator from quantum RNG
require 'open-uri'
rng = 'https://qrng.anu.edu.au/wp-content/plugins/colours-plugin/get_block_alpha.php'
ARGV.size < 1 ? pw_size = 16 : pw_size = ARGV[0].to_i
data = open(rng).read.strip.split('')
output = data.sample(pw_size)
puts output.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment