Skip to content

Instantly share code, notes, and snippets.

View seyedmohammadhosseini's full-sized avatar
💭
I may be slow to respond.

Seyed Mohammad Hosseini seyedmohammadhosseini

💭
I may be slow to respond.
  • Portugal
View GitHub Profile
@seyedmohammadhosseini
seyedmohammadhosseini / iota_python.py
Created May 28, 2019 15:41 — forked from simform-solutions/iota_python.py
Proof of work on python based IOTA implementation. Python 2.7 (not compatible yet with python 3) and the PyOTA library ***pip install pyota***
import getpass
import hashlib
import json
import time
import datetime
import re
import os
import RPi.GPIO as GPIO
from operator import itemgetter
@seyedmohammadhosseini
seyedmohammadhosseini / rsa.py
Created July 9, 2019 11:03 — forked from alairock/rsa.py
Simplify RSA encode and decode messages with the python rsa library.
import base64
import os
import rsa
def load_priv_key(path):
path = os.path.join(os.path.dirname(__file__), path)
with open(path, mode='rb') as privatefile:
keydata = privatefile.read()
return rsa.PrivateKey.load_pkcs1(keydata)