Esempio n. 1
0
def extract(stego_file, key, printoutput=False):
    # Decode from file (comment the first two lines to use the output from before)
    f = open(stego_file)
    out = string_to_binary(f.read())
    full = binary_to_string(decode(out))
    decrypted = decrypt_and_decompress(full.split('EOStegF')[0], key)
    if(printoutput):
        try:
            print decrypted
        except:
            output(decrypted, 'extracted.txt')
    return decrypted
Esempio n. 2
0
def extract(stego_file, key, offset=0, printoutput=False):
    # Decode from file (comment the first two lines to use the output from before)
    f = open(stego_file)
    full = f.read()
    audio = full.split('EOMp3F')[0]
    hashy = md5.new()
    hashy.update(audio)
    hashy = hashy.digest()
    ciphertext = full.split(hashy)[1]
    decrypted = decrypt_and_decompress(ciphertext, key)
    if(printoutput):
        try:
            print decrypted
        except:
            output(decrypted, 'extracted.txt')
    return decrypted