This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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): |