Skip to content

Instantly share code, notes, and snippets.

@atoponce
atoponce / w3w-two-word-compound-unsafe-words.txt
Created Apr 19, 2021
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"?
View w3w-two-word-compound-unsafe-words.txt
abashed
abated
abilities
ability
able
ably
aboard
about
abridged
abundance
View 0-letterblock.js
/*
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
View eff-passphrases.json
[{"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
View largest-deck-id.js
function factorial(n) {
let result = BigInt(1)
while (n > 0) {
result *= BigInt(n)
n--
}
return result
}
var deck = []
View lehmer.html
<!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 Jan 26, 2021
JavaScript TileKey generator
View tilekeys.html
<!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%;
View rotations.py
#!/usr/bin/env python
def _rot90(num):
counter = 0
bits = "{:09b}".format(num)
tmp = list(bits)
for idx in [6,3,0,7,4,1,8,5,2]:
tmp[idx] = bits[counter]
counter += 1
@atoponce
atoponce / examples.md
Last active Nov 26, 2020
Three password generators in ZSH
View examples.md

Each generator yields 128-bit security passwords. Each generator can take an optional numeric password to generate that many passwords. They should be placed in your ~/.zshrc. They are not portable across other shells.

gen-monkey-pass generates visually unambiguous random meaningless strings using Crockford's base32. Requires only ZSH:

% gen-monkey-pass 
9cws91tjck93f0xymjn33cjt7m
% gen-monkey-pass 3
@atoponce
atoponce / dbus-uuidgen.txt
Created Nov 14, 2020
D-bus UUID generator
View dbus-uuidgen.txt
$ for i in {1..50}; do printf "%02d: " $i; dbus-uuidgen; done
01: f7ce22e1c3ec82343e11a8035faf4860
02: 5973bebcc026a65797ed89a75faf4860
03: a3df92986e08d099b11924ab5faf4860
04: 5fa5585b4808fc2a2286a28b5faf4860
05: d2fda8ca45322051fecc8a685faf4860
06: 0ba63db9be3cee781275bd805faf4860
07: fb108d510955ba08f8c6bdd45faf4860
08: 60f97e492e5339f39a0783fd5faf4860
09: 55d7e5721db10bf2389156f55faf4860
@atoponce
atoponce / instructions.md
Last active Apr 3, 2021
Convert any binary to an image
View instructions.md

Convert any binary to PNG

This walk through comes from @GalacticFurball who tweeted two images representing the youtube_dl source code as of 2020-09-20. They mentioned later in the thread that they struggled converting the gzip-compressed tarball of the source code with Imagemagick to a PNG, so they ended up using a 3rd party website to do the work. This Gist will show you how to do it cleanly and exactly.

Instructions

If you would like to convert any non-image binary into PNG, Imagemagick makes this trivial. I will be executing the commands on a Debian Linux system, so you may need to adjust the commands for BSD, macOS, or Windows as necessary.