Skip to content

Instantly share code, notes, and snippets.

View MurageKibicho's full-sized avatar
🛼
Working from home

Murage Kibicho MurageKibicho

🛼
Working from home
  • Yale University
  • New Haven, Connnecticut
  • 04:37 (UTC -04:00)
View GitHub Profile
@MurageKibicho
MurageKibicho / PrivateKey.c
Created July 25, 2025 11:46
Hacking a dormant bitcoin wallet involves finding the wallet’s private key. Owning a bitcoin is equivalent to knowing a wallet’s private key. The process can be summarized as: A private key generates a public key. The public key is hashed by SHA256 + RIPEMD. The hash is encoded in Base58. The encoded Base58 string is the wallet address. We wrote…
//Complete guide : https://leetarxiv.substack.com/p/hacking-dormant-bitcoin-wallets-c
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <secp256k1.h>
#include <openssl/sha.h>
#include <openssl/ripemd.h>
//Run: clear && gcc PrivateKey.c -lsecp256k1 -lcrypto -o m.o && ./m.o
@MurageKibicho
MurageKibicho / PMat32.c
Last active July 24, 2025 01:23
Unsigned PMat32.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#define INDEX(x, y, cols) ((x) * (cols) + (y))
//We use unsigned integers
//Using signed integers is misaligned with our goal (Positive only integers)
@MurageKibicho
MurageKibicho / PMat32.c
Created July 23, 2025 14:57
PMat32 Checkpoint: Conversions
//Second Checkpoint in: https://leetarxiv.substack.com/p/positive-only-binary-pmat32
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#define INDEX(x, y, cols) ((x) * (cols) + (y))
typedef uint32_t PMat32;
@MurageKibicho
MurageKibicho / PMat32.c
Created July 23, 2025 13:07
Starter code for PMat32 Implementation Guide
//Full guide : https://leetarxiv.substack.com/p/positive-only-binary-pmat32
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#define INDEX(x, y, cols) ((x) * (cols) + (y))
//Run : clear && gcc PMat.c -lm -o m.o && ./m.o
@MurageKibicho
MurageKibicho / FirstPrimeFactor.c
Created July 22, 2025 01:19
Find the first prime factor of n
int FirstPrimeFactor(int n)
{
if(n == 0 || n == 1)
{
return n; // 0 and 1 have no prime factors
}
if(n < 0)
{
n = -n; // Work with absolute value
}
@MurageKibicho
MurageKibicho / FindCubeInPrimeFactorization.c
Created July 22, 2025 01:15
Test for the largest cubic prime factor
// Online C compiler to run C program online
#include <stdio.h>
int FindCubeInPrimeFactorization(int n)
{
if (n == 0) return 0; // 0³ = 0
if (n == 1) return 1; // 1³ = 1
int cube = 1;
for(int p = 2; p * p <= n; p++)
{
@MurageKibicho
MurageKibicho / ConicPlot.c
Created July 20, 2025 12:21
Function to solve conic equation y in terms of x
//Full derivation here: https://leetarxiv.substack.com/p/conic-sections-matrix-theory
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
typedef struct{ double x, y; }Point;
//Run: clear && gcc ConicPlot.c -lm -o m.o && ./m.o
// Solve conic equation for y given x
bool GetConicPoints(double A, double B, double C, double F, double G, double H, double x, Point* y1, Point* y2)
{
@MurageKibicho
MurageKibicho / ConicIdentify.c
Created July 20, 2025 09:41
C Function to Identify Conic Sections by Matrix Form
//Code Explained : https://leetarxiv.substack.com/p/conic-sections-matrix-theory
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#define COMPARE_EPSILON 1e-6f
#define INDEX(x, y, cols) ((x) * (cols) + (y))
typedef enum matrix_type_enum MatrixType;
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_opengles2.h>
#else
#include <SLD2/SDL.h>
#include <SDL2/SDL_opengles2.h>
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
@MurageKibicho
MurageKibicho / TextureCamera2.c
Created July 17, 2025 15:06
Texture camera second step
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_opengles2.h>
#else
#include <SLD2/SDL.h>
#include <SDL2/SDL_opengles2.h>
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846