Example #1
0
File: se.py Project: mcgov/xorf
def se(plain, keys):
	"""super encipher with an arbitrary amount of keys"""
	plain = x.chrxor( plain, keys[1], x.ascii_str, None, x.ascii_str, None, x.ascii_ord, x.ascii_ord  )
	
	for i in range( 2, len(keys)):
		plain = x.chrxor( plain, keys[i], x.int_array, None, x.ascii_str, None, x.dec_str_to_int, x.ascii_ord  )
		#print "i: " + str(i) + " " + print_as_hex(plain)
	return plain
Example #2
0
File: dse.py Project: mcgov/xorf
def dse( inp ):
	"""de-super-encipher an output from se.py. Pipe input from stdin, args should be the keys."""
	#print sys.argv[1]
	inp = x.chrxor( inp, sys.argv[1], x.ld_hex_of_len, 2, x.ascii_str, None, x.hex_to_int, x.ascii_ord)
	#print inp
	for i in range( 2, len(sys.argv)):
		#print i
		inp = x.chrxor( inp, sys.argv[i], x.int_array, None, x.ascii_str, None, x.integer, x.ascii_ord) 
	return inp
Example #3
0
def dse(inp):
    """de-super-encipher an output from se.py. Pipe input from stdin, args should be the keys."""
    #print sys.argv[1]
    inp = x.chrxor(inp, sys.argv[1], x.ld_hex_of_len, 2, x.ascii_str, None,
                   x.hex_to_int, x.ascii_ord)
    #print inp
    for i in range(2, len(sys.argv)):
        #print i
        inp = x.chrxor(inp, sys.argv[i], x.int_array, None, x.ascii_str, None,
                       x.integer, x.ascii_ord)
    return inp