Last time I said it works? I was kidding. Try this.

This commit is contained in:
cedricbonhomme 2010-10-06 10:21:47 +02:00
parent 96a65a45a2
commit b3cb1d5f69
5 changed files with 12 additions and 10 deletions

View file

@ -1,4 +1,4 @@
#! /usr/local/bin/python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Stéganô - Stéganô is a basic Python Steganography module. # Stéganô - Stéganô is a basic Python Steganography module.

View file

@ -1,4 +1,4 @@
#! /usr/local/bin/python #!/usr/bin/env python
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# Stéganô - Stéganô is a basic Python Steganography module. # Stéganô - Stéganô is a basic Python Steganography module.
@ -174,7 +174,7 @@ if __name__ == '__main__':
img = Image.open(options.input_image_file) img = Image.open(options.input_image_file)
secret = reveal(img) secret = reveal(img)
if options.secret_binary != "": if options.secret_binary != "":
data = base64.b64decode(secret) data = tools.base642binary(secret)
with open(options.secret_binary, "w") as f: with open(options.secret_binary, "w") as f:
f.write(data) f.write(data)
else: else:

View file

@ -1,4 +1,4 @@
#! /usr/local/bin/python #!/usr/bin/env python
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# Stéganô - Stéganô is a basic Python Steganography module. # Stéganô - Stéganô is a basic Python Steganography module.

View file

@ -1,4 +1,4 @@
#! /usr/local/bin/python #!/usr/bin/env python
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# Stéganô - Stéganô is a basic Python Steganography module. # Stéganô - Stéganô is a basic Python Steganography module.

View file

@ -1,4 +1,4 @@
#! /usr/local/bin/python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Stéganô - Stéganô is a basic Python Steganography module. # Stéganô - Stéganô is a basic Python Steganography module.
@ -24,6 +24,8 @@ __version__ = "$Revision: 0.1 $"
__date__ = "$Date: 2010/10/01 $" __date__ = "$Date: 2010/10/01 $"
__license__ = "GPLv3" __license__ = "GPLv3"
import base64
def a2bits(chars): def a2bits(chars):
""" """
Converts a string to its bits representation as a string of 0's and 1's. 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. Convert a printable file to a binary file.
""" """
# Read base64 string # Read base64 string
fin = open(b64_fname, "r") #fin = open(b64_fname, "r")
b64_str = fin.read() #b64_str = fin.read()
fin.close() #fin.close()
# Decode base64 string to original binary sound object # Decode base64 string to original binary sound object
return base64.b64decode(b64_str) return base64.b64decode(b64_fname)