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
#!/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 November 5, 2023 17:08
Three password generators in ZSH

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 November 14, 2020 03:02
D-bus UUID generator
$ 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 January 7, 2025 06:04
Convert any binary to an image

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.

@atoponce
atoponce / instructions.md
Last active January 28, 2025 05:52
Tutorial for generating Bitcoin wallet mnemonic seeds by hand (almost)

Creating a BIP39 mnemonic 100% by hand (almost)

This document shows how we can create Bitcoin wallet mnemonic seeds by hand in a provably secure way. It follows the BIP-39 specification. The steps are straight forward, and we'll go into each of them in detail with this doc.

The steps are as follows:

  • Generate cryptographically secure bits
  • Divide into 11-bit bytes
@atoponce
atoponce / dicekey-wordlist-14400.txt
Last active February 16, 2021 00:30
14,400 word list for the DiceKey
AB1N a
AB1E aah
AB1S abacus
AB1W abide
AB2N able
AB2E abroad
AB2S absurd
AB2W acadia
AB3N ace
AB3E aced
@atoponce
atoponce / index.html
Last active August 29, 2020 20:52
Clean room DiceKey web generator
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Secure DiceKey Generator</title>
<script>
function secureRandGen(count) {
let min = (-count >>> 0) % count;
let randBytes = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
@atoponce
atoponce / results.md
Last active June 17, 2020 18:53
World AeroPress Championship winning recipes

World AreoPress Championship Winning Recipes

Comments

Just a basic table. See the full instructions at the WAC winners page.

World AeroPress Competition recipes are typically concentrate-then-dilute. This leads to higher losses of brewed coffee in the discarded puck. The coffee is generally coarser and brewed at lower temperatures to produce high acidity, but it also brews underextracted. Higher quantities of coffee are used (30+ grams)

@atoponce
atoponce / hash.vb
Created June 9, 2020 01:19
15-bit Pearson hash function for LibreOffice Calc
' REM 15-bit Pearson Hash, because I can't figure out 32-bits for FNV-1a
Function Hash(strText as String) as Long
Dim h As Long
Dim nextChar As String
Dim temp As Long
Dim table(0 To 32767) as Long
Dim seed as Long
seed = 1
h = len(strText) MOD 32768
@atoponce
atoponce / 0-readme.md
Last active May 26, 2020 06:56
Alternate EFF long list in Deseret and Shavian alphabet characters

Alternate EFF long list in Deseret and Shavian alphabet characters

An Idea for Passphrases

Knowing the growing support for Unicode support on the web, including HTML forms, such as usernames and passwords, I decided to create two English spelling reform Diceware word lists in the Deseret Alphabet and the Shavian Alphabet.