@dicewarebot, the solution I needed that no one asked for
Tags: python, random, problem, twitter
Published: 2020-08-21 23:25:00

---
title: @dicewarebot, the solution I needed that no one asked for
published: true
description: 
tags: python, random, problem, twitter
//cover_image: https://direct_url_to_image.jpg
---

> Originally published @ https://kylerconway.com/2020/08/21/dicewarebot-the-solution-i-needed-that-no-one-asked-for/

A number of years ago I was trying to learn python. Random numbers have always amused me (as I was recently reminded by a twitter nod to the weird usage of spreadsheets). 

![](https://kylerconway.com/wp-content/uploads/2020/08/Screenshot-from-2020-08-21-17-54-13.png)

A user named [@context_ing tweeted](https://twitter.com/context_ing/status/1293313076268118019): “I love finding the ways in which people use spreadsheets. Personally, I use them for mostly budgeting, workout tracking and travel planning. Here’s a few in the wild I’ve found. Would love to see more! Please share if you’ve come across any or have any yourself.”

I felt compelled to reply with my own little story. “Reminds me of a decade old excel project. A playwriting book said something like “I guess it would be a play if you cut up words from a dictionary and pulled them out one-by-one, arranging them into lines of 10 words under character names, but it wouldn’t be a very good one.” So I took the entire public domain text of Oscar Wilde’s classic and had Excel recreate the play on every reopen of the file by randomly selecting words and character names I think using a vlookup and random. The result was interesting (and likely bad theatre).”

The text in question (blasted tweet limits!) was Oscar Wilde’s The Importance of Being Earnest. The resulting play was garbage, but that random interger generation was magical. When combined with other functions it really could do wonderful things for art.

Fast forward some (10?) years and I had a different problem to deal with: I needed to seamlessly transition all staff and clients from one grouping of technology services at one company to a different group of technology services at a new and different non-profit that was going to just continue doing basically the same work for basically the same people.

To remove almost all complexity from this story: I needed passwords; lots of random, unique, and strong passwords.

I once again turned to my friend the random number generator, but this time in python rather than excel. I coded up a script that would allow me to specify the number of words I wanted, unique separator I desired, and―importantly―how many of these unique passwords I wanted to be generated in one go.

I had the program roll digital dice and lookup words from the [EFF’s Diceware password list](https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases) and then spit them out. People would get their passwords and privately think I was just very adept at coming up with wacky sounding passwords, but I did not deserve this misconception as random integers were to blame for everything.

Eventually I thought it would be a good idea to create a sort of Public Service Announcement on the web about the odd truth that a list of words obtained by rolling dice really can be unique.

The end result is a Twitter bot and a Mastodon bot that very frequently tweet out unique passwords they’ve generated (though you probably shouldn’t use them). More people follow on Mastodon than Twitter, and Twitter relatively frequently blocks my bot’s tweets makes me unnecessarily prove that there’s a human behind the bot to get things going again (anyone at Twitter can explain this?).

At any rate, here’s some examples embedded below. Note that I also added the Harry Potter wordlist as well. There are others for your enjoyment on [EFF’s site.](https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases)

Lastly, there are infinitely better versions of this if you’re looking to generate a password. I’d recommend the much more easily installed [passphraseme by Micah Lee.](https://github.com/micahflee/passphraseme)

<blockquote class="twitter-tweet"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/letsroll?src=hash&amp;ref_src=twsrc%5Etfw">#letsroll</a> <a href="https://twitter.com/hashtag/muggles?src=hash&amp;ref_src=twsrc%5Etfw">#muggles</a> <a href="https://twitter.com/hashtag/d20?src=hash&amp;ref_src=twsrc%5Etfw">#d20</a><br><br>18-18-14 → <a href="https://twitter.com/hashtag/england?src=hash&amp;ref_src=twsrc%5Etfw">#england</a><br>20-4-1 → <a href="https://twitter.com/hashtag/representative?src=hash&amp;ref_src=twsrc%5Etfw">#representative</a><br>3-9-13 → <a href="https://twitter.com/hashtag/greeted?src=hash&amp;ref_src=twsrc%5Etfw">#greeted</a><br>14-16-17 → <a href="https://twitter.com/hashtag/disappeared?src=hash&amp;ref_src=twsrc%5Etfw">#disappeared</a><br>14-7-6 → <a href="https://twitter.com/hashtag/transported?src=hash&amp;ref_src=twsrc%5Etfw">#transported</a><br>3-4-2 → <a href="https://twitter.com/hashtag/strong?src=hash&amp;ref_src=twsrc%5Etfw">#strong</a><br><br>england-representative-greeted-disappeared-transported-strong<br><br>Roll your own @ <a href="https://t.co/q1skhcu0sG">https://t.co/q1skhcu0sG</a></p>&mdash; dicewarebot (@dicewarebot) <a href="https://twitter.com/dicewarebot/status/1296937698037567491?ref_src=twsrc%5Etfw">August 21, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> 

<blockquote class="twitter-tweet"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/letsroll?src=hash&amp;ref_src=twsrc%5Etfw">#letsroll</a><br><br>⚄ ⚅ ⚁ ⚅ ⚁→<a href="https://twitter.com/hashtag/steed?src=hash&amp;ref_src=twsrc%5Etfw">#steed</a><br>⚄ ⚀ ⚄ ⚁ ⚀→<a href="https://twitter.com/hashtag/require?src=hash&amp;ref_src=twsrc%5Etfw">#require</a><br>⚁ ⚀ ⚀ ⚅ ⚂→<a href="https://twitter.com/hashtag/cosmetics?src=hash&amp;ref_src=twsrc%5Etfw">#cosmetics</a><br>⚀ ⚄ ⚃ ⚅ ⚂→<a href="https://twitter.com/hashtag/chevy?src=hash&amp;ref_src=twsrc%5Etfw">#chevy</a><br>⚁ ⚃ ⚀ ⚂ ⚀→<a href="https://twitter.com/hashtag/doze?src=hash&amp;ref_src=twsrc%5Etfw">#doze</a><br>⚅ ⚁ ⚅ ⚄ ⚁→<a href="https://twitter.com/hashtag/truffle?src=hash&amp;ref_src=twsrc%5Etfw">#truffle</a><br><br>steed-require-cosmetics-chevy-doze-truffle<br><br>Roll your own @ <a href="https://t.co/vIw88QUBey">https://t.co/vIw88QUBey</a></p>&mdash; dicewarebot (@dicewarebot) <a href="https://twitter.com/dicewarebot/status/1296930425739325444?ref_src=twsrc%5Etfw">August 21, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> 

At any rate, I hope you enjoyed my PSA.