Skip to content

Instantly share code, notes, and snippets.

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get update
sudo apt-get install golang-go -y
wget https://dist.ipfs.io/go-ipfs/v0.4.15/go-ipfs_v0.4.15_linux-386.tar.gz
tar xvfz go-ipfs_v0.4.15_linux-386.tar.gz
sudo mv go-ipfs/ipfs /usr/local/bin/ipfs
@davidp94
davidp94 / generate_rsa_3072.py
Created March 20, 2018 13:07
Generate RSA 3072 bits public keys and private keys python with cryptography package and print them in PEM/PKCS format
from cryptography.hazmat.primitives import serialization as crypto_serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend as crypto_default_backend
key = rsa.generate_private_key(
backend=crypto_default_backend(),
public_exponent=65537,
key_size=3072
)
private_key = key.private_bytes(
@davidp94
davidp94 / generate_secp256k1.py
Created March 20, 2018 11:50
generate secp256k1 and print in hex string
# might require pip install ecdsa
from ecdsa import SigningKey, SECP256k1
sk = SigningKey.generate(curve=SECP256k1) # uses SECP256k1
vk = sk.get_verifying_key()
print('This is the secret key {} \nThis is the public key {}'.format(sk.to_string().hex(), vk.to_string().hex()))
@davidp94
davidp94 / snarktest.solidity
Created October 14, 2017 01:15 — forked from chriseth/snarktest.solidity
zkSNARKs test code
// This file is MIT Licensed.
//
// Copyright 2017 Christian Reitwiessner
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O