6213 Сарычев Н.В. Лаб.3 Вар.8 (17)#219
Open
exhaustion666 wants to merge 29 commits intoitsecd:mainfrom
Open
Conversation
Daria-creator-lab
requested changes
May 27, 2025
lab_3/asymmetric_crypto.py
Outdated
| if not (32 <= key_length_bits <= 448 and key_length_bits % 8 == 0): | ||
| raise ValueError("Blowfish key length must be between 32-448 bits in 8-bit increments.") | ||
|
|
||
| key_bytes = os.urandom(key_length_bits // 8) |
There was a problem hiding this comment.
зачем вы ограничили пользователя вашей системы?
он должен иметь возможность задать ключ самостоятельно
lab_3/asymmetric_crypto.py
Outdated
Comment on lines
27
to
29
| save_binary(config["public_key"], public_key.public_bytes(encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.SubjectPublicKeyInfo)) | ||
| save_binary(config["secret_key"], private_key.private_bytes(encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.TraditionalOpenSSL, encryption_algorithm=serialization.NoEncryption())) | ||
|
|
Author
|
Теперь пользователь вводит длину ключа через аргумент командной строки с помощью python main.py generation --key-bits key_bits (где key_bits длина ключа в битах), а функция generate_keys() принимает на вход еще и полученную длину ключа. Также исправил недочет по PEP. |
Daria-creator-lab
approved these changes
May 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
В ходе лабораторной работы мне нужно было реализовать гибридную криптосистему, которая будет сочетать в себе преимущества симметричных и ассиметричных алгоритмов шифрования.
Модуль file_utils.py используется для работы с файлами.
Модуль asymmetric_crypto.py используется для генерации ключа с помощью RSA алгоритма.
Модуль symmetric_crypto.py используется для шифровки и дешифровки информации, используя алгоритм Blowfish.
Модуль main.py является основным.
Для запуска программы необходимо указать аргументы командной строки:
python main.py generation для генерации ключей
python main.py encryption для шифровки информации
python main.py decryption для дешифровки информации.