def main(blindSignature, pRDashComponents): with open('requerentComponents.dat', 'r') as fp: blindComponents = fp.readline() errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(blindSignature, pRDashComponents): with open("Req/blindComponents", "r") as blindC: blindComponents = blindC.read() errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(blindSignature, pRDashComponents): print("Input") blindComponents, pRComponents = load_settings() errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(): print("Input") blindSignature = raw_input("Blind signature: ") blindComponents = raw_input("Blind components: ") pRDashComponents = raw_input("pRDash components: ") errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(argv): blind_signature = '' p_r_dash_components = '' d = dict() input_file = '' try: opts, args = getopt.getopt(argv, "h:s:", ["signature=", "RDash=", "in="]) except getopt.GetoptError: print 'desofusca-app.py -s <Blind Signature> --RDash <pRDashComponents> --in file' sys.exit(2) for opt, arg in opts: if opt == '-h': print 'desofusca-app.py -s <Blind Signature> --RDash <pRDashComponents> --in file' sys.exit() elif opt in ("-s", "--signature"): blind_signature = arg elif opt == "--RDash": p_r_dash_components = arg elif opt == "--in": input_file = arg f = open(input_file, "r") for l in f: w = l.strip().split(":") d[w[0].strip()] = w[1].strip() blind_components = d['Blind components'] error_code, signature = eccblind.unblindSignature(blind_signature, p_r_dash_components, blind_components) show_results(error_code, signature)
def main(): blindSignature = sys.argv[2] blindComponents = getBlindComponents() pRDashComponents = sys.argv[4] errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(blSig,rDash): print("Input") filename = open('initComponents.txt','r') lines = filename.readlines() blindComponents = lines[0] filename.close() errorCode, signature = eccblind.unblindSignature(blSig, rDash, blindComponents) showResults(errorCode, signature)
def main(blindSignature, pRDashComponents): with open("ReqComp.txt", 'r') as file: lines = file.readlines() blindComponents = lines[0] errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(): blindSignature = sys.argv[2] pRDashComponents = sys.argv[4] with open('requester.txt', 'rb') as s: blindComponents = s.readline()[:-1] errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(): # @Jan/2021 - changed raw_input() to input() blindSignature = input("Blind signature: ") blindComponents = input("Blind components: ") pRDashComponents = input("pRDash components: ") errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(): blindSignature = sys.argv[2] pRDashComponents = sys.argv[4] file = open("requerente.txt", "r") blindComponents = file.readline()[:-1] errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(sig, rdash): #print("Input") blindSignature = sig blindComponents = getBlindComponents() pRDashComponents = rdash errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def parseArgs(): if (len(sys.argv) == 5 and sys.argv[1] == '-s' and sys.argv[3] == '-RDash'): with open('requerente.txt', 'r') as out: blindComponents = out.readline().rstrip() errorCode, signature = eccblind.unblindSignature( sys.argv[2], sys.argv[4], blindComponents) showResults(errorCode, signature) else: printUsage()
def main(): blindSignature = sys.argv[2] file = open('Blind_Components.txt', 'r') blindComponents = file.readline().rstrip('\n') file.close() pRDashComponents = sys.argv[4] errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(blindSignature, pRDashComponents): with open('requesterFile.txt', 'r') as f: file = f.read() blindComponents = file[18:file.find('\n')] errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
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 main(): with open('ficheiro_do_requerente', 'r') as f: blindComponents = f.readline() if (sys.argv[1] == '-s') and (sys.argv[3] == '-RDash'): blindSignature = sys.argv[2] pRDashComponents = ys.argv[4] else: print("Error") errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(blindSignature,pRDashComponents): f=open("BlindMsgCmp.txt",'r') x=f.read() f.close() blindComponents,pRComponents = x.split('\n') errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(blindSignature, pRDashComponents): f = open('outputRequester.txt', 'r') lines = f.readlines() f.close() blindComponents = lines[0] errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(tipoInput): if (tipoInput == 1): # Abrir Ficheiro Assinante e retirar BlindSignature. f = open('ficheiroAssinante.txt', 'r') blindSignature = f.readlines()[2].split(': ')[1] f.close() # Abrir Ficheiro Requerente e retirar BlindComponents. f = open('ficheiroRequerente.txt', 'r') blindComponents = f.readlines()[0].split(': ')[1] f.close() # Abrir Ficheiro Assinante e retirar pRDashComponents. f = open('ficheiroAssinante.txt', 'r') pRDashComponents = f.readlines()[1].split(': ')[1] print(pRDashComponents) f.close() errorCode, signature = eccblind.unblindSignature( blindSignature, pRDashComponents, blindComponents) showAndSaveResults(errorCode, signature) else: blindSignature = sys.argv[2] # Abrir Ficheiro Requerente e retirar BlindComponents. f = open('ficheiroRequerente.txt', 'r') blindComponents = f.readlines()[0].split(': ')[1] f.close() pRDashComponents = sys.argv[4] errorCode, signature = eccblind.unblindSignature( blindSignature, pRDashComponents, blindComponents) showAndSaveResults(errorCode, signature)
def main(): blindSignature = sys.argv[2] pRDashComponents = sys.argv[4] fileData = dict() with open("reqFile.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 blindComponents = fileData["blindComponents"] errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(): args, _ = getopt.getopt(sys.argv[1:], "s:", ["RDash="]) args = dict(args) if "-s" in args: blindSignature = args["-s"] if "--RDash" in args: pRDashComponents = args["--RDash"] print("Input") blindComponents = raw_input("Blind components: ") errorCode, signature = eccblind.unblindSignature( blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature) else: printUsage() else: printUsage()
def main(): print('Input') ficheiro = raw_input('Nome ficheiro com o blindComponents: ') f = open(sys.argv[2], 'r') blindSignature = f.readlines()[0] f.close() f = open(ficheiro, 'r') blindComponents = f.readlines()[0] f.close() f = open(sys.argv[4], 'r') pRDashComponents = f.readlines()[1] f.close() errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature) ficheiro1 = raw_input('Nome ficheiro com a assinatura: ') f = open(ficheiro1, 'wb') f.write(signature) f.close() print('Output') print(signature)
def main(): args = args_Parser() if (args.blindSing and args.blindComp and args.prDash): try: blindSignature = utils.readFile(args.blindSing[0]) blindComponents = utils.readFile(args.blindComp[0]) pRDashComponents = utils.readFile(args.prDash[0]) except: sys.exit("Can't open File") else: sys.exit("Nao foram passados argumentos suficientes") errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) if (errorCode is None): writeToFile('signature.txt', signature) else: exitCode(errorCode)
def main(pRDashComponents, blindSignature, blindComponents): print("Input") errorCode, signature = eccblind.unblindSignature(blindSignature.read(), pRDashComponents.read(), blindComponents.read()) showResults(errorCode, signature)
def main(blindSignature, pRDashComponents): print("Input") blindComponents, pRComponents = load_settings() # Carrega do ficheiro do Requerente as components errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def unblindDataAssData(assData): print("Input") blindComponents = raw_input("Blind components: ") pRDashComponents = raw_input("pRDash components: ") errorCode, signature = eccblind.unblindSignature(assData, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(blindSignature, pRDashComponents): blindComponents = getBlindComps() errorCode, signature = eccblind.unblindSignature(blindSignature, pRDashComponents, blindComponents) showResults(errorCode, signature)
def main(blindS, pr): blindSignature = utils.readFile(blindS) blindComponents = utils.readFile(pr) errorCode, signature = eccblind.unblindSignature(blindSignature, pr, blindComponents) showResults(errorCode, signature)