This file contains hidden or 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
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Date; | |
/* | |
A simple example of a blockchain demonstrating how data stored in it cannot be changed. | |
*/ | |
class Block { |
This file contains hidden or 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
import random | |
import math | |
class RSA: | |
def __init__(self): | |
self.e = self.d = self.p = self.q = self.phi = 0 | |
def __egcd(self, a, b): | |
if a == 0: | |
return (b, 0, 1) |