def main(eccPrivateKeyPath, bm): pemKey = utils.readFile(eccPrivateKeyPath) blindM = utils.readFile(bm) passphrase = getpass() initComponents = utils.readFile("Assinante.txt", "r") errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(): blindM, eccPrivateKeyPath, initComponents = parseArgs() pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(argv): ecc_private_key_path = '' blind_m = '' input_file = '' d = dict() try: opts, args = getopt.getopt(argv, "h:", ["key=", "bmsg=", "inputFile="]) except getopt.GetoptError: print 'blind_signature-app.py --key <chave privada> --bmsg <Blind message> --inputFile <ficheiro>' sys.exit(2) for opt, arg in opts: if opt == '-h': print 'blind_signature-app.py --key <chave privada> --bmsg <Blind message> --inputFile <ficheiro>' sys.exit() elif opt == "--key": ecc_private_key_path = arg elif opt == "--bmsg": blind_m = arg elif opt == "--inputFile": input_file = arg pem_key = utils.readFile(ecc_private_key_path) passphrase = raw_input("Passphrase: ") f = open(input_file, "r") for l in f: w = l.strip().split(":") d[w[0].strip()] = w[1].strip() error_code, blind_signature = eccblind.generateBlindSignature( pem_key, passphrase, blind_m, d["initComponents"]) show_results(error_code, blind_signature)
def main(eccPrivateKeyPath, blindM): pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") initComponents = open("init.txt", "r") errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM.read(), initComponents.read()) showResults(errorCode, blindSignature)
def allOptions(eccPrivateKeyPath, blindMsg): pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") initComponents = raw_input("Init components: ") errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindMsg, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath): pemKey = utils.readFile(eccPrivateKeyPath) passphrase = raw_input("Input your passphrase: ") blindM = sys.argv[4] initComponents = getInitComponents() errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath, blindM): pemKey = utils.readFile(eccPrivateKeyPath) initcompfile = open("xcomponents.data", "r") passphrase = "" initComponents = initcompfile.readline() errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath, blindM): initComponents, pRDashComponents = load_settings() pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath,blindM): pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") with open("AssComp.txt",'r') as file: lines = file.readlines() initComponents = lines[0] errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath): pemKey = utils.readFile(eccPrivateKeyPath) passphrase = raw_input("Passphrase: ") blindM = sys.argv[4] file = open("assinante.txt", "r") file.readline() initComponents = file.readline() errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath, blindM): with open(eccPrivateKeyPath, 'r') as fp: pemKey = fp.read() passphrase = getpass() with open('componentsAssinante.dat', 'r') as fp: initComponents = fp.readline() errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath): pemKey = utils.readFile(eccPrivateKeyPath) # @Jan/2021 - changed raw_input() to input() passphrase = input("Passphrase: ") blindM = input("Blind message: ") initComponents = input("Init components: ") errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath, blindM): pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") with open("Signer/initComponents", "r") as initcomp: initComponents = initcomp.read() errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath): pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") blindM = raw_input("Blind message: ") initComponents = raw_input("Init components: ") errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(): pemKey = utils.readFile(sys.argv[2]) blindM = sys.argv[4] file = open("assinante.txt", "r") initComponents = file.readline()[:-1] errorCode, result = eccblind.generateBlindSignature( pemKey, "", blindM, initComponents) showResults(errorCode, result)
def main(eccPrivateKeyPath): pemKey = utils.readFile(eccPrivateKeyPath) passphrase = raw_input("Passphrase: ") blindM = sys.argv[4] file = open('init_Sig.txt','r') initComponents = file.readline().rstrip('\n') file.close() errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(): pemKey = utils.readFile(sys.argv[2]) print("Input") passphrase = raw_input("Passphrase: ") blindM = sys.argv[4] with open('signer.txt', mode='rb') as initFile: initComponents = initFile.readline()[:-1] errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
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)
def parseArgs(): if (len(sys.argv) == 5 and sys.argv[1] == '-key' and sys.argv[3] == '-bmsg'): pemKey = utils.readFile(sys.argv[2]) with open('assinante.txt', 'r') as out: initComponents = out.readline().rstrip() passphrase = raw_input("Passphrase: ") errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, sys.argv[4], initComponents) showResults(errorCode, blindSignature) else: printUsage()
def main(eccPrivateKeyPath, blindM): try: with open('signerFile.txt', 'r') as f: file = f.read() except FileNotFoundError: print('Ficheiro signerFile.txt não encontrado!') initComponents = file[16:file.find('\n')] pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = getpass.getpass(prompt="Passphrase: ") errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath, blindM): pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") f = open('outputSigner.txt', 'r') lines = f.readlines() f.close() initComponents = lines[0] errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(eccPrivateKeyPath, blindM): pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") f = open("Signercomponents.txt", 'r+') x = f.read() f.close() initComponents, prdash = x.split("\n") print(initComponents) errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(tipoInput, eccPrivateKeyPath): pemKey = utils.readFile(eccPrivateKeyPath) if (tipoInput == 1): print("Input\n") passphrase = raw_input("Passphrase: ") # Abrir Ficheiro Requerente e retirar BlindMessage. f = open('ficheiroRequerente.txt','r') blindMessage = f.readlines()[2].split(': ')[1] f.close() # Abrir Ficheiro Assinante e retirar InitComponents. f = open('ficheiroAssinante.txt','r') initComponents = f.readlines()[0].split(': ')[1] f.close() errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindMessage, initComponents) showAndSaveResults(errorCode, blindSignature) else: print("Input\n") passphrase = raw_input("Passphrase: ") blindMessage = sys.argv[4] # Abrir Ficheiro Assinante e retirar InitComponents. f = open('ficheiroAssinante.txt','r') initComponents = f.readlines()[0].split(': ')[1] f.close() errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindMessage, initComponents) showAndSaveResults(errorCode, blindSignature)
def main(eccPrivateKeyPath): pemKey = utils.readFile(eccPrivateKeyPath) blindM = sys.argv[4] fileData = dict() with open("sigFile.txt") as raw_data: for item in raw_data: if ':' in item: key, value = item.split(':', 1) fileData[key] = value else: pass # deal with bad lines of text here initComponents = fileData["initComponents"] print("\nInput") passphrase = raw_input("Passphrase: ") errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature)
def main(): args, _ = getopt.getopt(sys.argv[1:], "", ["key=", "bmsg="]) args = dict(args) if "--key" in args: eccPrivateKeyPath = args["--key"] if "--bmsg" in args: blindM = args["--bmsg"] print(blindM) pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase: ") initComponents = raw_input("Init components: ") errorCode, blindSignature = eccblind.generateBlindSignature(pemKey, passphrase, blindM, initComponents) showResults(errorCode, blindSignature) else: printUsage() else: printUsage()
def main(eccPrivateKeyPath): pemKey = utils.readFile(eccPrivateKeyPath) print("Input") passphrase = raw_input("Passphrase do key.pem: ") ficheiro = raw_input("Nome do ficheiro blindSignature: ") f = open(sys.argv[4], 'r') blindM = f.readlines()[2] f.close() f = open('init.txt', 'r') initComponents = f.readlines()[0] f.close() errorCode, blindSignature = eccblind.generateBlindSignature( pemKey, passphrase, blindM, initComponents) f = open(ficheiro, 'w+') f.write(blindSignature) f.close() showResults(errorCode, blindSignature)