Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys, compressor, os
- w = """Usage:
- script.py <File> <level(integer)> <Command(below)>
- Commands:
- Steg_In
- Steg_Out"""
- try:inf,level,com=sys.argv[1],sys.argv[2],sys.argv[3]
- except:print w;sys.exit(0)
- def Steg_In(n):
- context = open(inf, 'rb').read()
- indexes = [ord(i) for i in context]
- mixed = [i+n for i in indexes]
- new = [chr(i) for i in mixed]
- with open(inf, 'wb') as end:
- end.write(''.join(new))
- end.close()
- compressor.compress(inf, inf)
- def Steg_Out(n):
- compressor.decompress(inf, inf)
- context = open(inf, 'rb').read()
- indexes = [ord(i) for i in context]
- mixed = [i-n for i in indexes]
- new = [chr(i) for i in mixed]
- with open(inf, 'wb') as end:
- end.write(''.join(new))
- end.close()
- def main():
- __all__ = 'Steg_In', 'Steg_Out'
- if com not in __all__:print w;sys.exit(0)
- if com == __all__[0]:Steg_In(int(level))
- else:Steg_Out(int(level))
- if __name__=="__main__":main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement