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 / 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
@atoponce
atoponce / gels.md
Created June 4, 2024 23:13
Table of several energy gels for endurance athletes and their analysis results.

Gel Nutritional Facts

Sample Requestor Date Serving Actual Serving Diff. Label kCal Actual kCal kCal Diff. Label CHO Actual CHO CHO Diff.
Gu Chocolate Outrage Jason Koop 2024-05-29 32g 32g 0% 100 113 +13% 21g 24g +14%
Gu Strawberry Banana Brady Burgess [2024-06-04](https://www.irunfar.com
@atoponce
atoponce / canyons.md
Last active August 5, 2024 21:22
Some downhill canyon routes for training the quads. A few of the routes could be modified to add/remove mileage as needed. For those courses with two grades listed, there is a notable flat or uphill section somewhere in the middle for at least 1 mile. The Ogden and St. George and Marathons are listed as benchmarks.
@atoponce
atoponce / chaocipher-test-vector.txt
Last active May 23, 2024 16:56
Chaocipher analysis
> const Chaocipher = require('./chaocipher.js')
undefined
> const left = "HXUCZVAMDSLKPEFJRIGTWOBNYQ"
undefined
> const right = "PTLNBQDEOYSFAVZKGJRIHWXUMC"
undefined
> const pt = "WELLDONEISBETTERTHANWELLSAID"
undefined
> const cipher = new Chaocipher(left, right)
undefined