Esempio n. 1
0
 def test_hide_empty_message(self):
     """
     Test hiding the empty string.
     """
     with self.assertRaises(AssertionError):
         lsbset.hide("./tests/sample-files/Lenna.png", "",
                     generators.eratosthenes())
Esempio n. 2
0
 def test_manual_convert_rgb(self, input):
     message_to_hide = "Hello World!"
     lsbset.hide(
         "./tests/sample-files/Lenna-grayscale.png",
         message_to_hide,
         generators.eratosthenes(),
     )
Esempio n. 3
0
 def test_with_too_long_message(self):
     with open("./tests/sample-files/lorem_ipsum.txt") as f:
         message = f.read()
     message += message*2
     with self.assertRaises(Exception):
         lsbset.hide("./tests/sample-files/Lenna.png", message,
                                 generators.identity())
Esempio n. 4
0
 def test_with_too_long_message(self):
     with open("./tests/sample-files/lorem_ipsum.txt") as f:
         message = f.read()
     message += message * 2
     with self.assertRaises(Exception):
         lsbset.hide("./tests/sample-files/Lenna.png", message,
                     generators.identity())
Esempio n. 5
0
 def test_with_unknown_generator(self):
     message_to_hide = "Hello World!"
     with self.assertRaises(AttributeError):
         lsbset.hide(
             "./tests/sample-files/Lenna.png",
             message_to_hide,
             generators.eratosthene(),  # type: ignore
         )
Esempio n. 6
0
 def test_auto_convert_rgb(self):
     message_to_hide = "Hello World!"
     lsbset.hide(
         "./tests/sample-files/Lenna-grayscale.png",
         message_to_hide,
         generators.eratosthenes(),
         auto_convert_rgb=True,
     )
Esempio n. 7
0
 def test_refuse_convert_rgb(self, input):
     message_to_hide = "Hello World!"
     with self.assertRaises(Exception):
         lsbset.hide(
             "./tests/sample-files/Lenna-grayscale.png",
             message_to_hide,
             generators.eratosthenes(),
         )
Esempio n. 8
0
 def test_hide_empty_message(self):
     """
     Test hiding the empty string.
     """
     with self.assertRaises(AssertionError):
         secret = lsbset.hide("./tests/sample-files/Lenna.png", "",
                                 generators.eratosthenes())
Esempio n. 9
0
def hide_author(user, pic_name):
    message = user.username
    new_file = str(hash(pic_name)) + '.png'
    secret = lsbset.hide(path_to_pics + pic_name, message,
                         generators.eratosthenes())
    path = path_to_pics + new_file
    secret.save(path)
    return new_file
Esempio n. 10
0
    def test_hide_and_reveal_with_bad_generator(self):
        message_to_hide = "Hello World!"
        secret = lsbset.hide("./tests/sample-files/Lenna.png", message_to_hide,
                             generators.eratosthenes())
        secret.save("./image.png")

        with self.assertRaises(IndexError):
            clear_message = lsbset.reveal("./image.png", generators.identity())
Esempio n. 11
0
    def test_hide_and_reveal_with_bad_generator(self):
        message_to_hide = "Hello World!"
        secret = lsbset.hide("./tests/sample-files/Lenna.png", message_to_hide,
                                    generators.eratosthenes())
        secret.save("./image.png")

        with self.assertRaises(IndexError):
            clear_message = lsbset.reveal("./image.png", generators.identity())
Esempio n. 12
0
def hide(message: str, image_src_path: str, image_destination_path: str):
    """Hide a message in an image.
    Example:
    hide("I love ponies.", "image.jpg", "hidden.png")
    """
    # doesn't work with .jpg, but works with .png
    if not image_destination_path.endswith(".png"):
        raise Exception("Destination image should have .png extension")
    image = lsbset.hide(image_src_path, message, generators.eratosthenes())
    image.save(image_destination_path)
Esempio n. 13
0
    def test_hide_and_reveal_UTF32LE(self):
        messages_to_hide = 'I love 🍕 and 🍫!'
        secret = lsbset.hide("./tests/sample-files/Lenna.png",
                             messages_to_hide, generators.eratosthenes(),
                             'UTF-32LE')
        secret.save("./image.png")

        clear_message = lsbset.reveal("./image.png", generators.eratosthenes(),
                                      'UTF-32LE')
        self.assertEqual(messages_to_hide, clear_message)
Esempio n. 14
0
    def test_with_transparent_png(self):
        messages_to_hide = ["a", "foo", "Hello World!", ":Python:"]
        for message in messages_to_hide:
            secret = lsbset.hide("./tests/sample-files/transparent.png",
                                 message, generators.eratosthenes())
            secret.save("./image.png")

            clear_message = lsbset.reveal("./image.png",
                                          generators.eratosthenes())

            self.assertEqual(message, clear_message)
Esempio n. 15
0
    def test_hide_and_reveal_with_shift(self):
        messages_to_hide = ["a", "foo", "Hello World!", ":Python:"]
        for message in messages_to_hide:
            secret = lsbset.hide("./tests/sample-files/Lenna.png", message,
                                 generators.eratosthenes(), 4)
            secret.save("./image.png")

            clear_message = lsbset.reveal("./image.png",
                                          generators.eratosthenes(), 4)

            self.assertEqual(message, clear_message)
Esempio n. 16
0
    def test_hide_and_reveal_with_ackermann(self):
        messages_to_hide = ["foo"]
        for message in messages_to_hide:
            secret = lsbset.hide("./tests/sample-files/Lenna.png", message,
                                 generators.ackermann(m=3))
            secret.save("./image.png")

            clear_message = lsbset.reveal("./image.png",
                                          generators.ackermann(m=3))

            self.assertEqual(message, clear_message)
Esempio n. 17
0
    def test_with_transparent_png(self):
        messages_to_hide = ["a", "foo", "Hello World!", ":Python:"]
        for message in messages_to_hide:
            secret = lsbset.hide("./tests/sample-files/transparent.png",
                                    message, generators.eratosthenes())
            secret.save("./image.png")

            clear_message = lsbset.reveal("./image.png",
                                    generators.eratosthenes())

            self.assertEqual(message, clear_message)
Esempio n. 18
0
    def test_hide_and_reveal_UTF32LE(self):
        messages_to_hide = 'I love 🍕 and 🍫!'
        secret = lsbset.hide("./tests/sample-files/Lenna.png",
                            messages_to_hide,
                            generators.eratosthenes(),
                            'UTF-32LE')
        secret.save("./image.png")

        clear_message = lsbset.reveal("./image.png", generators.eratosthenes(),
                                        'UTF-32LE')
        self.assertEqual(messages_to_hide, clear_message)
Esempio n. 19
0
def add_steg(path, bpp):
    '''
    Add steg to each image in directory

    param:
    path - str path to data folder containing .pngs
    bpp - float desired bits per pixel

    return:
    None
    '''
    filecounter = len([path for path in walk_dir(path)])

    gen = DocumentGenerator()

    if (args.generators):
        lsb_generators = [
            getattr(generators, entry) for entry in args.generators
        ]

    count = 0

    for filepath in tqdm(walk_dir(path), total=filecounter, unit='files'):
        try:
            im = Image.open(filepath)
            im_size = im.size[0] * im.size[1]
            # average sentence length is 60 bytes -> 480 bits
            message = '\n'.join(
                [gen.sentence() for i in range(int(im_size * bpp / 480))])
            # remove non-ascii characters as they mess up steganography
            message = message.encode('ascii', 'ignore').decode()

            if (args.generators):
                # + 1 to add normal lsb
                gen_index = int(count % (len(lsb_generators) + 1))

                if (gen_index == len(lsb_generators)):
                    secret = lsb.hide(filepath, message)
                    secret.save(filepath.replace('.png', '.steg.png'))
                else:
                    lsb_gen = lsb_generators[gen_index]
                    secret = lsbset.hide(filepath, message, lsb_gen())
                    secret.save(
                        filepath.replace('.png',
                                         f".{args.generators[gen_index]}.png"))
            else:
                secret = lsb.hide(filepath, message)
                secret.save(filepath.replace('.png', '.steg.png'))
            count += 1
        except Exception as e:
            print(e)
            print(filepath)
Esempio n. 20
0
    def encodePngWithSet(self, path, string, choice=None):
#        if ".png" not in path:
#            path = path + ".png"
#        if choice is None:
#            choice = "Fibonacci"
#        if "./" not in path:
#            path = "./" + path
#        print(self.choices)
        print(choice)
        print(self.choices)
        newImage = lsbset.hide(path, string, self.choices[choice]())
        newImage.save("./Steganography/steganized/"+os.path.basename(path))
        print("Called!")
Esempio n. 21
0
def sign_image(signature: str, image_file_path: Union[str, IO[bytes]]):
    copied_file_path = "{}_{}.tmp".format(image_file_path, time.time())
    copyfile(image_file_path, copied_file_path)

    exifHeader.hide(input_image_file=copied_file_path,
                    img_enc=image_file_path,
                    secret_message=signature)
    os.remove(copied_file_path)

    secret_image = lsbset.hide(input_image=image_file_path,
                               message=signature,
                               generator=generators.fermat())
    secret_image.save(image_file_path)
Esempio n. 22
0
    def test_with_location_of_image_as_argument(self):
        messages_to_hide = ["Hello World!"]

        for message in messages_to_hide:
            outputBytes = io.BytesIO()
            bytes_image = lsbset.hide(
                "./tests/sample-files/20160505T130442.jpg", message,
                generators.identity())
            bytes_image.save(outputBytes, "PNG")
            outputBytes.seek(0)

            clear_message = lsbset.reveal(outputBytes, generators.identity())

            self.assertEqual(message, clear_message)
Esempio n. 23
0
    def test_hide_and_reveal_with_shi_tomashi(self):
        messages_to_hide = ["foo bar"]
        for message in messages_to_hide:
            secret = lsbset.hide(
                "./tests/sample-files/Lenna.png",
                message,
                generators.shi_tomashi("./tests/sample-files/Lenna.png"),
            )
            secret.save("./image.png")

            clear_message = lsbset.reveal(
                "./image.png",
                generators.shi_tomashi("./tests/sample-files/Lenna.png"))

            self.assertEqual(message, clear_message)
Esempio n. 24
0
def getSnapshot(url,width,height,name,key,visuel,watermark):
    from selenium import webdriver
    options = webdriver.ChromeOptions()
    options.binary_location = '/usr/bin/google-chrome'
    options.add_argument('headless')

    options.add_argument('window-size=%dx%d' % (width,height+100))
    cdservice = service.Service('/usr/bin/chromedriver')
    states[key] = {'etat':u'Génération du visuel','avancement':20}
    cdservice.start()
    driver = webdriver.Chrome(chrome_options=options)
    states[key] = {'etat':u'Génération du visuel','avancement':30}

    driver.get(url);
    states[key] = {'etat':u'Génération du visuel','avancement':40}


    for i in range(6):
        time.sleep(0.5)
        states[key] = {'etat':u'Génération du visuel','avancement':60+i*5}

    im = Image.open(BytesIO(driver.get_screenshot_as_png()))
    im2 = im.crop((0,0,width,height))
    driver.quit()
    cdservice.stop()
    output = BytesIO()
    import json
    data = json.loads(watermark)
    if data['visuel'] in ['urgdem','urgsoc','eurque','paxint','prohum','urgeco']:
        im2 = add_corners(im2,30)

    im2.save(output,'PNG')

    # Watermark / stegano

    import json
    output.seek(0)
    secret_image = lsbset.hide(output, watermark, generators.eratosthenes())
    output_final = BytesIO()
    secret_image.save(output_final,'PNG')

    states[key] = {'etat':u'Génération du visuel','avancement':100}

    return output.getvalue()
    return output_final.getvalue()
Esempio n. 25
0
# r = requests.get(base_url + '/blocks/' + str(latest_fin_eth_blk_num)).json()
# msg = bytes(str(r['hash']) +'_'+ str(r['time']), 'utf-8')
msg = b'fe895898b8064515820af15e1921f8b5ae3c1660bb5dfd63bc07c04ce236972b_2018-12-16T17:36:36Z'

# 3. Sign msg with pk
sig = pk.sign_msg(msg)

# Stegano's jpg support is broken.
img = Image.open("sample.jpg")
img.save("sample.png")
del img

# 4. encode sig into img
# there has got to be an easier way...
secret_sig = base56.encode(base16.decode(sig.to_hex()[2:].upper()))
vessel_img = lsbset.hide("sample.png", secret_sig, generators.eratosthenes())
vessel_img.save("sig0.png")

# 5. Hash vessel_img
vih = sha3.keccak_256(vessel_img.tobytes()).digest()


'''VERIFICATION EXAMPLE'''
# 4. Prover provides verifer with secret_sig and generator used, verifer extracts secret_sig
revealed_sig = lsbset.reveal("sig0.png", generators.eratosthenes())
# "sanity" check
# base16.encode(base56.decode(revealed_sig)).lower() == sig.to_hex()[2:]

# Convert back into a eth_key Signature
rsig = keys.Signature(bytes.fromhex(base16.encode(base56.decode(revealed_sig))))
Esempio n. 26
0
def main():
    parser = argparse.ArgumentParser(prog='stegano-lsb-set')
    subparsers = parser.add_subparsers(help='sub-command help', dest='command')

    # Subparser: Hide
    parser_hide = subparsers.add_parser('hide', help='hide help')
    # Original image
    parser_hide.add_argument("-i",
                             "--input",
                             dest="input_image_file",
                             required=True,
                             help="Input image file.")
    parser_hide.add_argument(
        "-e",
        "--encoding",
        dest="encoding",
        choices=tools.ENCODINGS.keys(),
        default='UTF-8',
        help="Specify the encoding of the message to hide." +
        " UTF-8 (default) or UTF-32LE.")

    # Generator
    parser_hide.add_argument("-g",
                             "--generator",
                             dest="generator_function",
                             action=ValidateGenerator,
                             nargs='*',
                             required=True,
                             help="Generator (with optional arguments)")
    parser_hide.add_argument("-s",
                             "--shift",
                             dest="shift",
                             default=0,
                             help="Shift for the generator")

    group_secret = parser_hide.add_mutually_exclusive_group(required=True)
    # Non binary secret message to hide
    group_secret.add_argument("-m",
                              dest="secret_message",
                              help="Your secret message to hide (non binary).")
    # Binary secret message to hide
    group_secret.add_argument(
        "-f",
        dest="secret_file",
        help="Your secret to hide (Text or any binary file).")

    # Image containing the secret
    parser_hide.add_argument("-o",
                             "--output",
                             dest="output_image_file",
                             required=True,
                             help="Output image containing the secret.")

    # Subparser: Reveal
    parser_reveal = subparsers.add_parser('reveal', help='reveal help')
    parser_reveal.add_argument("-i",
                               "--input",
                               dest="input_image_file",
                               required=True,
                               help="Input image file.")
    parser_reveal.add_argument(
        "-e",
        "--encoding",
        dest="encoding",
        choices=tools.ENCODINGS.keys(),
        default='UTF-8',
        help="Specify the encoding of the message to reveal." +
        " UTF-8 (default) or UTF-32LE.")
    parser_reveal.add_argument("-g",
                               "--generator",
                               dest="generator_function",
                               action=ValidateGenerator,
                               nargs='*',
                               required=True,
                               help="Generator (with optional arguments)")
    parser_reveal.add_argument("-s",
                               "--shift",
                               dest="shift",
                               default=0,
                               help="Shift for the generator")
    parser_reveal.add_argument(
        "-o",
        dest="secret_binary",
        help="Output for the binary secret (Text or any binary file).")

    # Subparser: List generators
    parser_list_generators = subparsers.add_parser('list-generators',
                                                   help='list-generators help')

    arguments = parser.parse_args()

    if arguments.command != 'list-generators':
        try:
            arguments.generator_function[0]
        except AttributeError:
            print('You must specify the name of a generator.')
            parser.print_help()
            exit(1)

        try:
            if (arguments.generator_function[0] == "LFSR"):
                # Compute the size of the image for use by the LFSR generator if needed
                tmp = tools.open_image(arguments.input_image_file)
                size = tmp.width * tmp.height
                tmp.close()
                arguments.generator_function.append(size)
            if (len(arguments.generator_function) > 1):
                generator = getattr(
                    generators, arguments.generator_function[0])(
                        *[int(e) for e in arguments.generator_function[1:]])
            else:
                generator = getattr(generators,
                                    arguments.generator_function[0])()

        except AttributeError as e:
            print("Unknown generator: {}".format(arguments.generator_function))
            exit(1)

    if arguments.command == 'hide':
        if arguments.secret_message != None:
            secret = arguments.secret_message
        elif arguments.secret_file != "":
            secret = tools.binary2base64(arguments.secret_file)

        img_encoded = lsbset.hide(arguments.input_image_file, secret,
                                  generator, int(arguments.shift))
        try:
            img_encoded.save(arguments.output_image_file)
        except Exception as e:
            # If hide() returns an error (Too long message).
            print(e)

    elif arguments.command == 'reveal':
        try:
            secret = lsbset.reveal(arguments.input_image_file, generator,
                                   int(arguments.shift))
        except IndexError:
            print("Impossible to detect message.")
            exit(0)
        if arguments.secret_binary != None:
            data = tools.base642binary(secret)
            with open(arguments.secret_binary, "w") as f:
                f.write(data)
        else:
            print(secret)

    elif arguments.command == 'list-generators':
        all_generators = inspect.getmembers(generators, inspect.isfunction)
        for generator in all_generators:
            print('Generator id:')
            print('    {}'.format(crayons.green(generator[0], bold=True)))
            print('Desciption:')
            print('    {}'.format(generator[1].__doc__))
Esempio n. 27
0
from stegano import lsbset
from stegano.lsbset import generators


if __name__ == '__main__':
    hFile = "./image.png"
    secret_message = 'Prova Druido'
    secret_image = lsbset.hide("./samples/hackcortona-logo.png",
                               secret_message,
                               generators.eratosthenes(),
                               auto_convert_rgb=True)
    secret_image.save(hFile)

    print('Message hidden in file: {}'.format(hFile))

    message = lsbset.reveal(hFile, generators.eratosthenes())
    print('Decrypted message: {}'.format(message))
Esempio n. 28
0
 def test_auto_convert_rgb(self):
     message_to_hide = "Hello World!"
     secret = lsbset.hide("./tests/sample-files/Lenna-grayscale.png",
                         message_to_hide, generators.eratosthenes(),
                         auto_convert_rgb=True)
Esempio n. 29
0
 def test_refuse_convert_rgb(self, input):
     message_to_hide = "Hello World!"
     with self.assertRaises(Exception):
         secret = lsbset.hide("./tests/sample-files/Lenna-grayscale.png",
                                 message_to_hide, generators.eratosthenes())
Esempio n. 30
0
 def test_with_unknown_generator(self):
     message_to_hide = "Hello World!"
     with self.assertRaises(AttributeError):
         secret = lsbset.hide("./tests/sample-files/Lenna.png",
                                 message_to_hide, generators.eratosthene())
Esempio n. 31
0
def hide_message_console(currentos,msg,image):
 #hide message for windows os
    if currentos == "windows":
        os.system("cls")
        #get the image file name and extension
        img = image.replace('"','')
        img = img.strip()
        img_name_arr = img.split("\\")
        img_name = img_name_arr[len(img_name_arr)-1]
        img_ext_arr = img_name.split(".")
        img_ext = img_ext_arr[len(img_ext_arr)-1]
        #method if image file is jpg or jpeg
        if img_ext == "jpg" or img_ext == "jpeg":
            print(colored("Message: "+msg,"green"))
            print(colored("Image: "+img_name,"green"))
            confirm = input(colored("Type Y to confirm X to retry -->> ","green"))
            if(confirm.lower() == "y"):
                #try to hide message to file
                try:
                    exifHeader.hide(img,"./Images/"+img_ext_arr[0]+".jpg", msg)
                    os.system("cls")
                    print(colored("Message Hidden In Image","green"))
                    print(colored("Image Available Under Images Folder","green"))
                    os.system("exit")
                except Exception as e:
                    print(colored("We have A Problem. Try Later...","red"))
                    os.system("exit")
            elif confirm.lower() == "x":
               os.system("cls")
               os.system("exit")
        #method if image file is png
        elif img_ext == "png":
            print(colored("Message: "+msg,"green"))
            print(colored("Image: "+img_name,"green"))
            confirm = input(colored("Type Y to confirm X to retry -->> ","green"))
            if(confirm.lower() == "y"):
                #try to hide msg to file
                try:
                    hide = lsbset.hide(img,msg,generators.eratosthenes())
                    hide.save("./Images/"+img_ext_arr[0]+".png")
                    os.system("cls")
                    print(colored("Message Hidden In Image","green"))
                    print(colored("Image Available Under Images Folder","green"))
                    os.system("exit")
                except Exception as e:
                    print(e)
                    print(colored("We have A Problem. Try Later...","red"))
                    os.system("exit")
            elif confirm.lower() == "x":
               os.system("cls")
               os.system("exit")
        #if image file is not supported
        else:
            print(colored("We Recommend using jpg,png Format Images","red"))
            os.system("exit")
    
    elif currentos == "linux":
        os.system("clear")
        #get the image file name and extension
        img = image.replace('"','')
        img = img.strip()
        img_name_arr = img.split("/")
        img_name = img_name_arr[len(img_name_arr)-1]
        img_ext_arr = img_name.split(".")
        img_ext = img_ext_arr[len(img_ext_arr)-1]
        #method if image file is jpg or jpeg
        if img_ext == "jpg" or img_ext == "jpeg":
            print(colored("Message: "+msg,"green"))
            print(colored("Image: "+img_name,"green"))
            confirm = input(colored("Type Y to confirm X to retry -->> ","green"))
            if(confirm.lower() == "y"):
                #try to hide message to file
                try:
                    exifHeader.hide(img,"./Images/"+img_ext_arr[0]+".jpg", msg)
                    os.system("clear")
                    print(colored("Message Hidden In Image","green"))
                    print(colored("Image Available Under Images Folder","green"))
                    os.system("exit")
                except Exception as e:
                    print(e)
                    #print(colored("We have A Problem. Try Later...","red"))
                    #os.system("exit")
            elif confirm.lower() == "x":
               os.system("clear")
               os.system("exit")
        #method if image file is png
        elif img_ext == "png":
            print(colored("Message: "+msg,"green"))
            print(colored("Image: "+img_name,"green"))
            confirm = input(colored("Type Y to confirm X to retry -->> ","green"))
            if(confirm.lower() == "y"):
                #try to hide msg to file
                try:
                    hide = lsbset.hide(img,msg,generators.eratosthenes())
                    hide.save("./Images/"+img_ext_arr[0]+".png")
                    os.system("clear")
                    print(colored("Message Hidden In Image","green"))
                    print(colored("Image Available Under Images Folder","green"))
                    os.system("exit")
                except Exception as e:
                    print(colored("We have A Problem. Try Later...","red"))
                    os.system("exit")
            elif confirm.lower() == "x":
               os.system("clear")
               os.system("exit")
        #if image file is not supported
        else:
            print(colored("We Recommend using jpg,png Format Images","red"))
            os.system("exit")
Esempio n. 32
0
    source += input() + "\n"
source = source.encode('ascii')
character_selection = string.ascii_letters + string.digits
key = ''.join(random.choice(character_selection) for i in range(10))
decoded_key = key
key = key.encode('ascii')

key = SHA256.new(key).digest()
IV = Random.new().read(AES.block_size)
encryptor = AES.new(key, AES.MODE_CBC, IV)
padding = AES.block_size - len(source) % AES.block_size
source += bytes([padding]) * padding
data = IV + encryptor.encrypt(source)
data_encrypted = base64.b64encode(data).decode("latin-1")

secret_image = lsbset.hide(file_name + ".png", data_encrypted,
                           generators.eratosthenes())
secret_image.save(output_file_name + ".png")

imgur_link = input(
    "Please upload the output file to imgur and enter its extension here: \n")
imgur_link_length = len(imgur_link)
middle = imgur_link_length

tweet_text = ""

for x in range(imgur_link_length):
    if x == 3:
        tweet_text = tweet_text + decoded_key + " "
    elif x == 6:
        tweet_text = tweet_text + imgur_link[x]
        continue
Esempio n. 33
0
def hide_file(currentos):
    if currentos == "windows":
        os.system("cls")
        #get file to hide
        file = input(colored("File Location -->> ","green"))
        #remove " and whitespace
        file = file.replace('"','')
        file = file.strip()
        #file extinsion
        file_addr = file.split("\\")
        file_name = file_addr[len(file_addr)-1]
        file_ext = file_name.split(".")
        ext = file_ext[len(file_ext)-1]
        #get image t hide file
        image = input(colored("Image To Hide File -->> ","green"))
        #get the image file name and extension
        img = image.replace('"','')
        img = img.strip()
        img_name_arr = img.split("/")
        img_name = img_name_arr[len(img_name_arr)-1]
        img_ext_arr = img_name.split(".")
        img_ext = img_ext_arr[len(img_ext_arr)-1]
        os.system("clear")
        if img_ext == "jpg" or img_ext == "jpeg":
            #try to hide message to file
            try:
                with open(file,'rb') as f:
                    data = f.read()
                data = data + file_name.encode()
                exifHeader.hide(img,"./Images/"+img_ext_arr[0]+".jpg", data)
            except Exception as e:
                print(colored(e,"red"))
            finally:
                print(colored("Filed Hidden In the Image...","green"))
                print(colored("File Is Under Images Folder "+img_ext_arr[0]+".jpg","yellow"))
                goto = input(colored("Type E(exit) M(main menu)"))
                if goto.lower() == "e":
                    os.system("exit")
                elif goto.lower() == "m":
                    banner(currentos)
                else:
                    print(colored("Wrong Input...","red"))
                    os.system("exit")

        elif img_ext == "png":
            try:
                with open(file,'rb') as f:
                    data = f.read()
                data = data + file_name.encode()
                hide = lsbset.hide(img,msg,generators.eratosthenes())
                hide.save("./Images/"+img_ext_arr[0]+".png")
            except Exception as e:
                print(colored(e,"red"))
            finally:
                print(colored("File Hidden In the Image...","green"))
                print(colored("File Is Under Images Folder "+img_ext_arr[0]+".jpg","yellow"))
                goto = input(colored("Type E(exit) M(main menu)"))
                if goto.lower() == "e":
                    os.system("exit")
                elif goto.lower() == "m":
                    banner(currentos)
                else:
                    print(colored("Wrong Input...","red"))
                    os.system("exit")
        #if image file is not supported
        else:
            print(colored("We Recommend using jpg,png Format Images","red"))
            os.system("exit")  
            
    elif currentos == "linux":
        os.system("clear")
        #get file to hide
        file = input(colored("File Location -->> ","green"))
        #remove " and whitespace
        file = file.replace('"','')
        file = file.strip()
        #file extinsion
        file_addr = file.split("/")
        file_name = file_addr[len(file_addr)-1]
        file_ext = file_name.split(".")
        ext = file_ext[len(file_ext)-1]
        #get image t hide file
        image = input(colored("Image To Hide File -->> ","green"))
        #get the image file name and extension
        img = image.replace('"','')
        img = img.strip()
        img_name_arr = img.split("/")
        img_name = img_name_arr[len(img_name_arr)-1]
        img_ext_arr = img_name.split(".")
        img_ext = img_ext_arr[len(img_ext_arr)-1]
        os.system("clear")
        if img_ext == "jpg" or img_ext == "jpeg":
            #try to hide message to file
            try:
                with open(file,'rb') as f:
                    data = f.read()
                data = data + file_name.encode()
                exifHeader.hide(img,"./Images/"+img_ext_arr[0]+".jpg", data)
            except Exception as e:
                print(colored(e,"red"))
            finally:
                print(colored("Filed Hidden In the Image...","green"))
                print(colored("File Is Under Images Folder "+img_ext_arr[0]+".jpg","yellow"))
                goto = input(colored("Type E(exit) M(main menu)"))
                if goto.lower() == "e":
                    os.system("exit")
                elif goto.lower() == "m":
                    banner(currentos)
                else:
                    print(colored("Wrong Input...","red"))
                    os.system("exit")

        elif img_ext == "png":
            try:
                with open(file,'rb') as f:
                    data = f.read()
                data = data + file_name.encode()
                hide = lsbset.hide(img,msg,generators.eratosthenes())
                hide.save("./Images/"+img_ext_arr[0]+".png")
            except Exception as e:
                print(colored(e,"red"))
            finally:
                print(colored("File Hidden In the Image...","green"))
                print(colored("File Is Under Images Folder "+img_ext_arr[0]+".jpg","yellow"))
                goto = input(colored("Type E(exit) M(main menu)"))
                if goto.lower() == "e":
                    os.system("exit")
                elif goto.lower() == "m":
                    banner(currentos)
                else:
                    print(colored("Wrong Input...","red"))
                    os.system("exit")
        #if image file is not supported
        else:
            print(colored("We Recommend using jpg,png Format Images","red"))
            os.system("exit")