def hide(cleartext_filename, file_to_hide_in, key, offset=0, output_filename=''): # Open cleartext and text to be hidden f = open(file_to_hide_in) k = f.read() hashy = md5.new() hashy.update(k) hashy = hashy.digest() bites = bytearray(k) f = open(cleartext_filename) j = 'EOMp3F' + hashy + compress_and_encrypt(f.read(),key) hiddenbites = bytearray(k) out = k + j output(out, output_filename) return out
def hide(cleartext_filename, file_to_hide_in, key, output_filename=''): # Open cleartext and text to be hidden f = open(file_to_hide_in) k = f.read() bites = bytearray(k) f = open(cleartext_filename) k = compress_and_encrypt(f.read(),key) + 'EOStegF' hiddenbites = bytearray(k) # Encode stego out = encode(bytearray_to_binary(bites),bytearray_to_binary(hiddenbites)) if(len(output_filename) < 1): name = 'out.' + str(file_to_hide_in).split('.')[1] print ('No filename specificed, outputting to ') + name output_filename = name output(binary_to_string(out), output_filename) return binary_to_string(out)