Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vigenère cipher: Issues in current implementation #3

Open
kobby-pentangeli opened this issue Sep 11, 2023 · 0 comments
Open

Vigenère cipher: Issues in current implementation #3

kobby-pentangeli opened this issue Sep 11, 2023 · 0 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Comments

@kobby-pentangeli
Copy link
Contributor

  1. Input Validation Vulnerability:
  • The prepare_string function is not called within the encrypt and decrypt functions. As such, these functions will not handle non-alphabetic characters and mixed case inputs correctly. This could potentially be used to introduce invalid characters into the encrypted text or to cause errors in decryption.
  1. Error Handling:
  • The use of unwrap_or_default() and unwrap_or() could potentially mask errors that occur during encryption and decryption, making the implementation less robust against malformed inputs or other unexpected conditions.
  1. Key Length Attack:
  • Since the extend_key function simply repeats the key to match the length of the plaintext, a short key might make the cipher more susceptible to attacks as it effectively reduces the cipher to a set of repeated Caesar ciphers.
  1. Denial of Service (DoS):
  • The current implementation does not have protections against excessively large inputs, which could be used to perform a denial-of-service attack by causing the program to consume large amounts of memory or CPU time.
  1. Timing Attack:
  • As with many cryptographic implementations, this code might be susceptible to timing attacks where an attacker measures the time taken to encrypt or decrypt messages to gather information about the key.

To make the implementation more secure and robust, we must introduce additional input validation, custom error handling, and possibly rate-limiting to prevent abuse. We must also explore ways to make the key generation more secure and to prevent potential timing attacks.

@kobby-pentangeli kobby-pentangeli added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant