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 / keyboardPatternPasswords.js
Last active December 5, 2025 22:50
Generates secure passwords with at least 72 bits symmetric security using patterns on the keyboard from different English layouts.
"use strict";
const COLEMAK = {
// top row
"`": ["1", "!"], get "~"() { return this["`"]; },
"1": ["`", "~", "2", "@", "q", "Q"], get "!"() { return this["1"]; },
"2": ["1", "!", "3", "#", "w", "W"], get "@"() { return this["2"]; },
"3": ["2", "@", "4", "$", "f", "F"], get "#"() { return this["3"]; },
"4": ["3", "#", "5", "%", "p", "P"], get "$"() { return this["4"]; },
"5": ["4", "$", "6", "^", "g", "G"], get "%"() { return this["5"]; },
@atoponce
atoponce / unicode-space.zsh
Last active December 2, 2025 13:34
Print "white space" of various types to see how they look and behave in different terminal emulators for password generators.
#!/usr/bin/env zsh
#
# Released to the public domain
#
# - No C0 control codes, except:
# - \u0009: tab character
# - \u001C: file separator (largest)
# - \u001D: group separator
# - \u001E: record separator
# - \u001F: unit separator
@atoponce
atoponce / index.js
Last active November 14, 2025 04:21
Very efficient type 4 UUID generator in vanilla JavaScript. Runs in ~7.81 cpb on an Intel Core i7-8650U @ 1.9 GHz.
const uuid = new UUID();
console.log(uuid.v4());
@atoponce
atoponce / peres.js
Created July 31, 2025 17:16
Peres randomness extractor
/**
* Peres extractor as described in http://dx.doi.org/10.1214/aos/1176348543
* @param {Array} bits - an array of biased bits to debias
* @param {Array} extracted - an array of extracted, unbiased bits
* @returns {Array} - an array of exatracted, unbiased bits
*/
function peres(bits, extracted) {
const u = []; // discarded bits Psi(u1, u2, u3, ...)
const v = []; // discarded bits Psi(v1, v2, v3, ...)
const l = bits.length - (bits.length & 1); // ensure an even length, dropping the last bit if odd
% sudo apt update --audit
Hit:1 https://mirrors.xmission.com/debian sid InRelease
Hit:2 https://updates.signal.org/desktop/apt xenial InRelease
Hit:4 https://packages.microsoft.com/repos/code stable InRelease
Hit:5 https://brave-browser-apt-release.s3.brave.com stable InRelease
Hit:3 https://repository.spotify.com stable InRelease
All packages are up to date.
Warning: https://packages.microsoft.com/repos/code/dists/stable/InRelease: Policy will reject signature within a year, see --audit for details
Audit: https://packages.microsoft.com/repos/code/dists/stable/InRelease: Sub-process /usr/bin/sqv returned an error code (1), error message is:
Signing key on BC528686B50D79E339D3721CEB3E94ADBE1229CF is not bound:
@atoponce
atoponce / 15360.moduli
Created March 7, 2025 13:18
15360-bit primes for OpenSSH DH key exchange
20250304224134 2 6 100 15359 2 E2B68D627FF29109BEEC996F94F50EB6683562CB9BD482E347924A090D858EDBB60D2067C39B41C885F07348DEAEE90771BB29C8BCD5FDE3BBCCF0358DC294F8F783F0AE6450AC923994275EE9FD42EAE41A9DD327A0439F2378BE5DE26DC1BEA5290EE752968366276BD3CAC05A6B309C2C138FD5BD46784E749E589BC3E713EB39B37171AB543E194BEC36FF1843A39F9E3739071E44FFF7A2D621E2469F7A53A70A6E9EEEFD46AB0F296DA1C57549A0622642D666940B38C241ECA50EF73D908C315AD9CC8C3FF294294B890D6A5A58D442DE27B8BC384F7BBCF7292C666FE8EC3BE4F1F20C1969913E0FE42369C1B154AEFEEE81B85518A5B285E2FDB822AC4EC960227A69AC146E4CFFB7670CD694ADE0192A6E6DE4C80C340CE9C2D557F016499B7699C223108899F640EA35ABF6C5D9D9D0E21F315971207DF7E364FD5EB1779AAEEB279B5E29E505B43CAEDB0C6684FD9177480FFB7B78936E6F40CF29006119BBBC91C00A1C94064169D360930B064F223256F3BEC1843FB1C2DF22A88CFE437983A1CBD0B8E9CAAFEA48D8F325C31719A939BB5C73D4238BEA9703421F52DD0200F5A995712A3C42371134175085D5507F4432354A25CA3CE4A3A9CBD672C3768E4E0A9F8CCFDAB98037BD7F08022AA330C3DB23CFF1D2770722C20FDA7E26D50CBA8C9A9B8737E1327933C
# filename: dh-kex bit sizes
./openssh-2.9.9p1/moduli: 1023,1534,2046,3190,4094
./openssh-2.9.9p2/moduli: 1023,1534,2046,3190,4094
./openssh-3.0.1p1/moduli: 1023,1534,2046,3190,4094
./openssh-3.0.2p1/moduli: 1023,1534,2046,3190,4094
./openssh-3.0p1/moduli: 1023,1534,2046,3190,4094
./openssh-3.1p1/moduli: 1023,1534,2046,3190,4094
./openssh-3.2.2p1/moduli: 1023,1534,2046,3190,4094
./openssh-3.2.3p1/moduli: 1023,1534,2046,3190,4094
./openssh-3.3p1/moduli: 1023,1534,2046,3190,4094
> deck
[
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52
]
> shuffle.mongean(deck
@atoponce
atoponce / genpass-apple.zsh
Last active September 11, 2024 00:52
Password generators written in ZSH
#!/usr/bin/env zsh
#
# Usage: genpass-apple [NUM]
#
# Generate a password made of 6 pseudowords of 6 characters each
# with the security margin of at least 128 bits.
#
# Example password: xudmec-4ambyj-tavric-mumpub-mydVop-bypjyp
#
# If given a numerical argument, generate that many passwords.
#!python3
gpus = 12 # rtx 4090
rate = 164.1 * 10**9 * gpus # md5
mins = 60 # seconds
hours = 3600 # seconds
days = 86400 # seconds
weeks = 86400 * 7 # seconds
months = 86400 * 30 # seconds
years = 86400 * 365.25 # seconds