Skip to content

Instantly share code, notes, and snippets.

View pilotmoon's full-sized avatar
🏠
Working from bed

Nick Moore pilotmoon

🏠
Working from bed
View GitHub Profile
@pilotmoon
pilotmoon / RVNReceiptValidation.m
Created November 16, 2020 17:45
Mac App Store Receipt Validation Sample (Mac OS X 10.7)
//
// RVNReceiptValidation.m
//
// Created by Satoshi Numata on 12/06/30.
// Copyright (c) 2012 Sazameki and Satoshi Numata, Ph.D. All rights reserved.
//
// This sample shows how to write the Mac App Store receipt validation code.
// Replace kRVNBundleID and kRVNBundleVersion with your own ones.
//
// This sample is provided because the coding sample found in "Validating Mac App Store Receipts"
@pilotmoon
pilotmoon / rsatool.py
Last active May 8, 2024 13:36 — forked from flavienbwk/rsatool.py
Generates all OpenSSL private key componments from two of the raw primitives: modulus (n), primes p and q, private exponent (d)
#!/usr/bin/env python3
# taken from https://gist.github.com/flavienbwk/54671449419e1576c2708c9a3a711d78
# and modified to work with python3. i also stripped out the pem generation and just dump all the parameters.
# Usage : python rsatool.py -n <decimal_modulus> -p <decimal_prime1> -q <decimal_prime2> -e <decimal_public_exponent>
# or : python rsatool.py -n <decimal_modulus> -d <decimal_private_exponent> -e <decimal_public_exponent>
import base64, fractions, optparse, random, math, gmpy2 as gmpy
def factor_modulus(n, d, e):