Skip to content

Commit

Permalink
Change module import
Browse files Browse the repository at this point in the history
  • Loading branch information
dhsdshdhk authored May 19, 2019
1 parent 565f28d commit 4716919
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lsb.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
The solution was to replace all module imports by "from . import module", instead of from module import a, b, c.#!/usr/bin/env python3
# Module for processing images, audios and the least significant bits.

import numpy
from PIL import Image
from crypt import encrypt_info, decrypt_info
from . import crypt

MAGIC_NUMBER = b'stegv3'

Expand Down Expand Up @@ -38,7 +38,7 @@ def insert_message(self, message, bits=2, parasite_filename=None, password=None)
raw_message_len = len(message).to_bytes(4, 'big')
formatted_message = format_message(message, raw_message_len, parasite_filename)
if password:
formatted_message = encrypt_info(password, formatted_message)
formatted_message = crypt.encrypt_info(password, formatted_message)
self.data = encode_message(self.data, formatted_message, bits)

def read_message(self, password=None):
Expand All @@ -47,7 +47,7 @@ def read_message(self, password=None):
if password:
try:
salt = bytes(msg[:16])
msg = decrypt_info(password, bytes(msg[16:]), salt)
msg = crypt.decrypt_info(password, bytes(msg[16:]), salt)
except:
print("Wrong password.")
return
Expand Down

0 comments on commit 4716919

Please sign in to comment.