コード例 #1
0
def generate_secrets(n, k, s):
    #_16byteNo_start = 1000000000000000
    #_16byteNo_end   = 9999999999999999
    #secret = random.randrange(_16byteNo_start,_16byteNo_end)
    prime = 18895749970915969007
    secret = s
    shares = sss.deal(n, k, prime, secret)
    return shares
コード例 #2
0
def generate_secrets(n, k, s):
	#_16byteNo_start = 1000000000000000
	#_16byteNo_end   = 9999999999999999
	#secret = random.randrange(_16byteNo_start,_16byteNo_end)
	prime  = 18895749970915969007
	secret = s
	shares = sss.deal(n,k,prime,secret)
	return shares
コード例 #3
0
ファイル: toyapp.py プロジェクト: vishnuvp/toyapp
def generate_secrets(file_name, n, k):
	_16byteNo_start = 1000000000000000
	_16byteNo_end   = 9999999999999999
	key = random.randrange(_16byteNo_start,_16byteNo_end)
	aes.encrypt_file(str(key),file_name)
	prime  = 18895749970915969007
	secret = key#int("1234567890123456")
	shares = sss.deal(n,k,prime,secret)
	return shares