mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-13 17:38:30 +02:00
Add an exception when the reveal function is called with the bad generator.
This commit is contained in:
parent
94e3112189
commit
96749a168e
1 changed files with 6 additions and 3 deletions
|
@ -101,9 +101,8 @@ def reveal(input_image_file, generator_function):
|
||||||
if bitab[-1] == ":" and limit == None:
|
if bitab[-1] == ":" and limit == None:
|
||||||
try:
|
try:
|
||||||
limit = int("".join(bitab[:-1]))
|
limit = int("".join(bitab[:-1]))
|
||||||
print limit
|
|
||||||
except:
|
except:
|
||||||
print bitab
|
pass
|
||||||
if len(bitab)-len(str(limit))-1 == limit :
|
if len(bitab)-len(str(limit))-1 == limit :
|
||||||
return "".join(bitab)[len(str(limit))+1:]
|
return "".join(bitab)[len(str(limit))+1:]
|
||||||
|
|
||||||
|
@ -171,7 +170,11 @@ if __name__ == '__main__':
|
||||||
print e
|
print e
|
||||||
|
|
||||||
elif options.reveal:
|
elif options.reveal:
|
||||||
secret = reveal(options.input_image_file, options.generator_function)
|
try:
|
||||||
|
secret = reveal(options.input_image_file, options.generator_function)
|
||||||
|
except IndexError:
|
||||||
|
print "Impossible to detect message."
|
||||||
|
exit(0)
|
||||||
if options.secret_binary != "":
|
if options.secret_binary != "":
|
||||||
data = tools.base642binary(secret)
|
data = tools.base642binary(secret)
|
||||||
with open(options.secret_binary, "w") as f:
|
with open(options.secret_binary, "w") as f:
|
||||||
|
|
Loading…
Add table
Reference in a new issue