Beispiel #1
0
def main():
    a = args.Args()

    arguments = a.parse()

    dw = DynWalls()
    dw.act(arguments.action, arguments)
Beispiel #2
0
        abstract = tup[col_abs_index]
        type = tup[col_type_index]
        individual = tup[col_ind_index]

        logger.debug("Reading %s, %s\n --------\n %s" %
                     (individual, type, abstract))

        topics = lib_service.get_annotations(abstract, True)

        logger.debug("Topics %s" % (topics))


# change this to file config
if __name__ == '__main__':
    import logging.config

    ps = uarg.Args()
    args = ps.get_args()

    logfile = 'log_topics_n4t.log'
    if args.log:
        logfile = args.log

    logging.basicConfig(filename=logfile,
                        format='%(asctime)s %(levelname)s %(message)s',
                        level=logger.DEBUG)

    logger.info("Arguments %s" % args)

    main()
        p1.start()
        p2.start()
        p3.start()
        p1.join()
        p2.join()
        p3.join()
        print("end")

    def export(self, queue):
        with open(self.outfile, 'w') as f:
            writer = csv.writer(f)
            while True:
                try:
                    data = queue.get(timeout=0.2)
                except:
                    break
                writer.writerow(data)


if __name__ == '__main__':
    _arg = args.Args(sys.argv[1:])
    configfile = _arg.get_arg('config')
    config = config.Config(configfile)
    userdatafile = _arg.get_arg('userdata')
    userinfo = userdata.UserData(userdatafile)
    outfile = _arg.get_arg('out')
    income = IncomeTaxCalculator(config, userinfo, outfile)
    income.multiprocess_calc()
    #print(income.salaryinfo)
    #income.export()
Beispiel #4
0
import sys
import args
from randomPrime import generate_list
import keyGen
import cript

if len(sys.argv) < 5:
    print("Parâmetros insuficientes!")
    print(
        "Uso: python RSA-MPrime.py <número de primos> <potência mínima> <potência máxima> <mensagem>"
    )
    exit()

params = args.Args(sys.argv)

# Preenche a lista com np primos aleatórios e diferentes entre si
p = generate_list(params.np, params.min_pot, params.max_pot)

# GERAÇÃO DE CHAVES

#Chave Pública <N, e> // Chave Partucular <N, d>
N = keyGen.calc_N(p)
phiN = keyGen.calc_phiN(p)
e = keyGen.get_e(phiN)  # Valor Relativamente Primo a phiN
d = keyGen.calc_d(e, phiN)  # Inversa de e módulo phiN

# Imprime as chaves pública e privada
keyGen.print_keys(N, e, d)

# CRIPTOGRAFIA
C = cript.cript_msg(params.msg, e, N)