Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@RandyMcMillan
RandyMcMillan / git-clone-gists
Created July 12, 2025 19:00
git-clone-gists
#!/bin/bash
# --- Configuration ---
INSTALL_DIR="/usr/local/bin"
SCRIPT_NAME="git-clone-gists"
# --- Functions ---
# Function to display usage information
show_usage() {
@RandyMcMillan
RandyMcMillan / tokio_oneshot.rs
Last active July 12, 2025 14:28 — forked from rust-play/playground.rs
tokio_oneshot.rs
use tokio::sync::oneshot;
async fn some_computation() -> String {
"represents the result of the computation".to_string()
}
#[tokio::main]
async fn main() {
let (tx, rx) = oneshot::channel();
@RandyMcMillan
RandyMcMillan / ashigaru-vuln-review.md
Created July 12, 2025 02:23 — forked from 84adam/ashigaru-whirlpool-analysis.md
Review of Ashigaru Terminal: Fix for RSA Blinding Deanonymization Vulnerability

Whirlpool RSA Blinding Vulnerability Analysis - Ashigaru Terminal

Executive Summary

After conducting a thorough security analysis of the Ashigaru Terminal codebase, we can definitively conclude that Ashigaru Terminal HAS implemented a fix for the RSA blinding deanonymization vulnerability. The client now uses hardcoded RSA public keys and explicitly rejects any attempts by the coordinator to provide different keys to different clients, effectively preventing the potential deanonymization attack vector.

Background on the Vulnerability

The RSA blinding vulnerability in Whirlpool coinjoins centers around the blind signature mechanism used during the mixing process. In a properly implemented coinjoin system, all participants should use the same RSA public key for blinding their signatures. However, if a malicious coordinator could send different RSA public keys to different clients, it would be able to deanonymize users by correlating the blinded signatures with their unblinded counterparts during

@RandyMcMillan
RandyMcMillan / tokio_spawn.rs
Last active July 9, 2025 12:48 — forked from rust-play/playground.rs
tokio_spawn.rs
use tokio::time::{Duration, sleep};
#[tokio::main]
async fn main() {
for _ in 0..1_000_000 {
tokio::spawn(async {
sleep(Duration::from_secs(1)).await;
});
}
println!("Spawned 1M tasks!");
@RandyMcMillan
RandyMcMillan / winternitz.ts
Created July 7, 2025 14:18 — forked from conduition/winternitz.ts
WInternitz One-time Signatures on Bitcoin using OP_CAT
// input witness stack:
// <h1> <b1>
// ...
// <h64> <b64>
// <ec_signature>
OP_DUP OP_TOALTSTACK // copy EC signature to alt stack
<G> OP_CHECKSIGVERIFY // verify EC signature matches TX
@RandyMcMillan
RandyMcMillan / tokio_get_string.rs
Last active July 5, 2025 14:26 — forked from rust-play/playground.rs
tokio_get_string.rs
#[tokio::main]
async fn main() {
tokio::spawn(async {
print!("{}", get_string().await);
});
}
async fn get_string() -> String {
String::from("string")
}
@RandyMcMillan
RandyMcMillan / tokio_mpsc.rs
Last active July 5, 2025 14:15 — forked from rust-play/playground.rs
tokio::sync::mpsc
use tokio::sync::mpsc;
//use tokio::time::{Duration, sleep};
#[tokio::main]
async fn main() {
let (tx, mut rx) = mpsc::channel(100);
tokio::spawn(async move {
for i in 0..10 {
tx.send(format!("event {}", i)).await.unwrap();
}
@RandyMcMillan
RandyMcMillan / datalimits.md
Created June 24, 2025 13:18 — forked from sonnyxsm/datalimits.md
Weighing the choice of removing or keeping OP_RETURN data limits in Bitcoin Core 5/9/2025

From Bitcoin Core version 0.9.0 released:

On OP_RETURN: There was been some confusion and misunderstanding in the community, regarding the OP_RETURN feature in 0.9 and data in the blockchain. This change is not an endorsement of storing data in the blockchain. The OP_RETURN change creates a provably-prunable output, to avoid data storage schemes – some of which were already deployed – that were storing arbitrary data such as images as forever-unspendable TX outputs, bloating bitcoin's UTXO database.Storing arbitrary data in the blockchain is still a bad idea; it is less costly and far more efficient to store non-currency data elsewhere.

Pros

Limits the delays of block propagation

OP_RETURN data remains prunable

Less stress on the UTXO set, which causes the blockchain to bloat in size

Mitigates mining centralization

@RandyMcMillan
RandyMcMillan / sum_phi.rs
Created June 8, 2025 16:49 — forked from rust-play/playground.rs
sum_phi.rs
// A placeholder function for a_k.
// YOU WILL NEED TO REPLACE THIS WITH YOUR ACTUAL DEFINITION OF a_k.
fn get_a_k(_k: i32) -> f64 {
// Example: For demonstration, let's just return 1.0 for all k.
// In a real scenario, this could be:
// - a value from a lookup table (e.g., if a_k is stored in a Vec)
// - a result of a mathematical formula (e.g., k! or 1/k)
// - a coefficient of a specific series (e.g., Fourier series, Taylor series)
1.0
}
@RandyMcMillan
RandyMcMillan / faux_rsa.rs
Last active July 5, 2025 14:29 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use num_bigint::{BigInt, BigUint, Sign};
use num_traits::{One, Zero};
use std::str::FromStr; // For parsing BigUint from strings (e.g., hex)
// --- RSA Core Functions ---
/// Performs modular exponentiation: base^exp % modulus
fn modpow(base: &BigUint, exp: &BigUint, modulus: &BigUint) -> BigUint {
// This is the core of RSA. `num-bigint` provides an optimized `modpow` method.
base.modpow(exp, modulus)