Skip to content

Instantly share code, notes, and snippets.

View atoponce's full-sized avatar
Crypto coffee

Aaron Toponce atoponce

Crypto coffee
View GitHub Profile
@atoponce
atoponce / keyboard-entropy.js
Last active July 4, 2021 02:50
Gathering entropy via timing between keypresses
#!/usr/bin/env node
'use strict'
const crypto = require('crypto')
const readline = require('readline')
const fs = require('fs');
const zlib = require('zlib');
// https://spellingbee.com/sites/default/files/inline-files/Words_of_the_Champions_Printable_FINAL.pdf
@atoponce
atoponce / mouse-entropy.html
Last active June 25, 2021 22:06
Mouse entropy in the browser using JavaScript
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>Mouse entropy</title>
<link rel='shortcut icon' href='data:image/x-icon;base64,AAABAAEAFB8QAAEABAA8AgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAUAAAAHwgGAAAA507tzgAAAgNJREFUSImtlr9PwkAUx781jqSbSHTQyKC7pn/AheimEBKNJgwMrCxE7FA3hgbTxDDiwMAICZtsXTUNTsw31IQEBw0pJLLhYO68/gAK9Zs0udd3/eR7L/fuKu0f7M3wJwkemabJx4QQX+zVhiee+WasKA7M5/P/AuXAXC6HYrEYGepacjqdhqZpkaDeGoIQgupDFbIsrwX1AQHg5PgE2r0GWZZBCFkJGghkUMMwVobOBQJAMpmEYRhIbCcYdCl4IZBBH2uPSGwnojtkim/FUX+qc6eLShAKCACxWAz1pzqODo+iOxSh1YcqFEURa+pyuxKQQXVdh6Io0R2K0nUdp6dnLORO1wYCgKreiVBEBjKoeFJthv2QUop+v4/xeIzPry9Mv6d4t22MRiMMP4Z8Xmigbduo1WrLpklzl0wphaqqPCaEeLtFCniCa0gpRalUgmVZ6L31+PvLq8tlDv3A3lsPhUIBjuMAANqtNs+lUil2ToYDmqaJ8m3ZNcGyLFBKAfxu6mw2y1KB/cyBzWYTlUpFzPErtSW4zGQy4Rw2Go0gmAQAr68vmEwm3OX5xcVCoHi5Swi47B3HQafT4fHNzTUb+pbNHAaCRHWfu3wc34p7+9gHXCQJAIYfQ9dvyO7ujivPFLpTgN8tNBgM0H3uiu02E6HS/sF

Boggle initially released in 1972, then rereleased 1992. Looking strictly at the English editions, here's a breakdown of the two sets. Note that I alphabetized the characters on each die, then alphabetized each die for assignment. I'm not concerned about which letter is adjacent to another on a specific die.

Die Old Set New Set
1 AACIOT AAEEGN
2 ABILTY ABBJOO
3 ABJMOQ ACHOPS
4 ACDEMP AFFKPS
5 ACELRS AOOTTW
6 ADENVZ CIMOTU
@atoponce
atoponce / wordlist-builder.py
Last active June 2, 2021 22:10
Simple proposal using BIPS-0039 to encode plus code character pairs into readable English words
#!/usr/bin/env python3
# https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt
with open('/tmp/english.txt', 'r') as f:
bips = f.readlines()
short_bips = []
# 442 unique words (all 4-character words)
for n in range(2048):
@atoponce
atoponce / w3w-two-word-compound-unsafe-words.txt
Created April 19, 2021 11:58
what3words that are not two-word compound safe, such as "wheel" "chair" "woman" "hood". Is that "wheelchair.woman.hood", "wheel.chairwoman.hood", or "wheel.chair.womanhood"?
abashed
abated
abilities
ability
able
ably
aboard
about
abridged
abundance
@atoponce
atoponce / 0-letterblock.js
Last active September 21, 2021 21:57
Improve the password generator security of https://www.draketo.de/english/secure-passwords
/*
Improves the security of https://www.draketo.de/english/secure-passwords:
- Replace the letters with the original proposal at https://www.draketo.de/software/letterblock-diceware
- All bigrams are kept, rather than truncating
- Replace Math.random() with crypto.getRandomValues()
- Replace Math.floor(Math.random() * length) with uniform modulo rejection
- Replace a character count with a minimum security margin
- The HTML "Length" input should be replaced with "Security minimum" (or something similar, in bits)
- Implement the checksum per https://www.draketo.de/software/letterblock-diceware
- Use 6 characters instead of 4 (or 7) for a uniform checksum
[{"Generator":"EFF","Wordlist":"Short","Password":"amino-delay-jaws-drama-draw-rash-staff-wages-prong-growl-clock-spot-slept","Characters":73,"Entropy":134}]
[{"Generator":"EFF","Wordlist":"Short","Password":"flame-most-shady-track-heap-wrath-poker-flyer-straw-alike-slaw-scoff-react","Characters":74,"Entropy":134}]
[{"Generator":"EFF","Wordlist":"Short","Password":"plant-essay-chump-wish-frown-pep-salsa-fetch-yeast-outer-petal-slam-banjo","Characters":73,"Entropy":134}]
[{"Generator":"EFF","Wordlist":"Short","Password":"spree-aroma-badge-gecko-front-aged-rival-dry-taste-widen-stain-scorn-scan","Characters":73,"Entropy":134}]
[{"Generator":"EFF","Wordlist":"Short","Password":"scuff-ankle-bulk-trial-diary-baggy-dust-neon-jeep-twins-sugar-swab-stays","Characters":72,"Entropy":134}]
[{"Generator":"EFF","Wordlist":"Short","Password":"muse-wreck-comic-blink-hula-gem-dry-wind-self-heat-twirl-spoon-craft","Characters":68,"Entropy":134}]
[{"Generator":"EFF","Wordlist":"Short","Password":"zebra-crazy-agony-keg-power-pl
function factorial(n) {
let result = BigInt(1)
while (n > 0) {
result *= BigInt(n)
n--
}
return result
}
var deck = []
<!doctype html>
<html>
<head>
<meta charset='utf-8'></meta>
<title>Lehmer Code</title>
<style>
input[type=text] {
font-family: monospace;
width: 450px;
}
@atoponce
atoponce / tilekeys.html
Created January 26, 2021 19:16
JavaScript TileKey generator
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Secure TileKey Generator</title>
<style>
.dot {
background-color: white;
border: 1px solid black;
border-radius: 50%;