def main(eccPrivateKeyPath, eccPublicKeyPath):
    initComponents, pRDashComponents = eccblind.initSigner()
    data = shamirsecret.generateSecret(80)
    errorCode, [blindComponents, pRComponents, blindM] = eccblind.blindData(pRDashComponents, data)
    pemKey = utils.readFile(eccPrivateKeyPath)
    passphrase = raw_input("Passphrase: ")
    errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindM, initComponents)
    errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents)
    pemPublicKey = utils.readFile(eccPublicKeyPath)
    errorCode, validSignature = eccblind.verifySignature(pemPublicKey, signature, blindComponents, pRComponents, data)
    showResults(errorCode, validSignature)
Beispiel #2
0
def main(length):
    sys.stdout.write("%s\n" % shamirsecret.generateSecret(length))