From 2496bced3cd586c075ee443d6c598ab44bc081e5 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Mar 2026 13:59:59 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?/=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..c880763 --- /dev/null +++ b/main.py @@ -0,0 +1,54 @@ +import stegano.lsb as lsb + + +class auth(): + def __init__(self): + login = input('LOGIN: ') + passwd = input('PASSWD: ') + + if len(login.strip()) != 0 and len(passwd.strip()): + main() + + +class main(): + def __init__(self): + + menu = ''' + + [1] - Спрятать текст в файле PNG или JPG + [2] - Раскрыть текст из файла PNG или JPG + help - вывести эту справку + exit - выход + + + ''' + print(menu) + + while True: + cmd = input('CMD: ') + + if len(cmd.strip()) != 0: + if len(cmd.strip()) == 'help': + print(menu) + elif len(cmd.strip()) == 'exit': + break + elif len(cmd.strip()) == '1': + img = input('Введите полный путь до файла PNG или JPG: ') + text = input("Введите текст который нужно скрыть в файле: ") + + if len(img.strip()) != 0 and len(text.strip()) != 0: + output = lsb.hide(img, text) + output.save('output.png') + print('Текст сохранен в файле "output.png"') + + elif len(cmd.strip()) == '2': + img = input('Введите полный путь до файла PNG или JPG: ') + + if len(img.strip()) != 0: + output = lsb.reveal(img) + output.save('output.txt') + print('Текст сохранен в файле "output.txt"') + + +if __name__ == '__main__': + auth() \ No newline at end of file