Open
Conversation
Daria-creator-lab
requested changes
May 26, 2025
lab_2/part1/cpp_sequence.txt
Outdated
lab_3/keygeneration.py
Outdated
|
|
||
| key_length = int(input("Введите длину симметричного ключа: ")) | ||
|
|
||
| if key_length < 32 or key_length > 448 or key_length % 8 != 0: |
There was a problem hiding this comment.
не совсем верное условие ,ключ длиной 512 пройдет
корректнее if 32 <= key_length <= 448 and key_length % 8 == 0:
lab_3/keygeneration.py
Outdated
Comment on lines
109
to
129
| @staticmethod | ||
| def load_private_key(path: str) -> RSAPrivateKey: | ||
| """ | ||
| Загружает приватный RSA ключ из файла. | ||
|
|
||
| :param path: Путь к файлу с приватным ключом. | ||
| :return: Загруженный приватный ключ. | ||
| """ | ||
|
|
||
| with open(path, "rb") as f: | ||
| private_key = serialization.load_pem_private_key( | ||
| f.read(), | ||
| password=None | ||
| ) | ||
| return private_key | ||
|
|
||
|
|
||
| @staticmethod | ||
| def load_encrypted_symmetric_key(path: str) -> bytes: | ||
| """ | ||
| Загружает зашифрованный симметричный ключ из файла. |
There was a problem hiding this comment.
эти функции уже реализованы в lab_3/file_work.py
lab_3/main.py
Outdated
Comment on lines
100
to
95
| if args.generation: | ||
| genereate_keys(settings) | ||
|
|
||
| elif args.encryption: | ||
| encrypt_mode(settings) | ||
|
|
||
| elif args.decryption: | ||
| decrypt_mode(settings) | ||
|
|
There was a problem hiding this comment.
для выбора режима шифрования используйте match/case и Enum
Daria-creator-lab
requested changes
May 27, 2025
lab_2/part1/cpp_sequence.txt
Outdated
There was a problem hiding this comment.
этого тут быть не должно
сделайте clean up кода
Daria-creator-lab
approved these changes
Jun 8, 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.
В работе была создана Гибридная криптосистема, совмещающая в себе два протокола RSA и Blowfish. Ассиметричным алгоритмом (RSA) был получен ключ для симметричного шифрования (Blowfish).
Папка keys - для хранения созданных в процессе шифрования ключей. Папка texts - для хранения изначального, зашифрованного и расшифрованного текстов