diff --git a/basic.py b/basic.py index 81d9a9a..3240033 100755 --- a/basic.py +++ b/basic.py @@ -1,4 +1,4 @@ -#! /usr/local/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Stéganô - Stéganô is a basic Python Steganography module. diff --git a/lsb-s.py b/lsb-s.py index 66fcd8d..79c265e 100755 --- a/lsb-s.py +++ b/lsb-s.py @@ -1,4 +1,4 @@ -#! /usr/local/bin/python +#!/usr/bin/env python #-*- coding: utf-8 -*- # Stéganô - Stéganô is a basic Python Steganography module. @@ -174,7 +174,7 @@ if __name__ == '__main__': img = Image.open(options.input_image_file) secret = reveal(img) if options.secret_binary != "": - data = base64.b64decode(secret) + data = tools.base642binary(secret) with open(options.secret_binary, "w") as f: f.write(data) else: diff --git a/steganalysis-parity.py b/steganalysis-parity.py index 51b4824..dab2fc7 100644 --- a/steganalysis-parity.py +++ b/steganalysis-parity.py @@ -1,4 +1,4 @@ -#! /usr/local/bin/python +#!/usr/bin/env python #-*- coding: utf-8 -*- # Stéganô - Stéganô is a basic Python Steganography module. diff --git a/steganalysis-statistics.py b/steganalysis-statistics.py index d791903..0dde5bc 100644 --- a/steganalysis-statistics.py +++ b/steganalysis-statistics.py @@ -1,4 +1,4 @@ -#! /usr/local/bin/python +#!/usr/bin/env python #-*- coding: utf-8 -*- # Stéganô - Stéganô is a basic Python Steganography module. diff --git a/tools.py b/tools.py index 3f30be2..d68914e 100755 --- a/tools.py +++ b/tools.py @@ -1,4 +1,4 @@ -#! /usr/local/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Stéganô - Stéganô is a basic Python Steganography module. @@ -24,6 +24,8 @@ __version__ = "$Revision: 0.1 $" __date__ = "$Date: 2010/10/01 $" __license__ = "GPLv3" +import base64 + def a2bits(chars): """ Converts a string to its bits representation as a string of 0's and 1's. @@ -100,8 +102,8 @@ def base642binary(b64_fname): Convert a printable file to a binary file. """ # Read base64 string - fin = open(b64_fname, "r") - b64_str = fin.read() - fin.close() + #fin = open(b64_fname, "r") + #b64_str = fin.read() + #fin.close() # Decode base64 string to original binary sound object - return base64.b64decode(b64_str) + return base64.b64decode(b64_fname) \ No newline at end of file