-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
32 lines (27 loc) · 1.47 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python
#
# @author: Manuel Huez
#
# Steganana is a steganography project, coded in Python. It makes the user
# able to hide content inside an image, and retrieve it with ease.
# The hidden content is nearly invisible to the end user.
import sys, argparse
from src.Steganana import Steganana
def main(argv):
parser = argparse.ArgumentParser(description='Easy to use steganography tool')
parser.add_argument('file', help='input file to be used to encode or decode the string')
parser.add_argument('--encode', help='encode the given string/file into the image')
parser.add_argument('--encode-file', help='encode from the given file (from --encode)', dest='fromfile', action='store_true')
parser.add_argument('--encode-string', help='encode using the given string (from --encode)', dest='fromfile', action='store_false')
parser.add_argument('--output', help='output file of the encoding process', nargs='?')
parser.add_argument('--silent', help='silent mode, does not output anything except decoded data', dest='silent', action='store_true')
parser.add_argument('--verbose', help='verbose mode, outputs what\'s going on under the hood', dest='silent', action='store_false')
parser.set_defaults(silent=False, fromfile=False, output='output.png')
args = parser.parse_args()
steganana = Steganana(args.file, args.silent)
if(args.encode == None):
print steganana.decode()
else:
steganana.encode(args.encode, args.fromfile, args.output)
if __name__ == '__main__':
main(sys.argv[1:])