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

Affine cipher: Issues in current implementation #5

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

Affine cipher: Issues in current implementation #5

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:
  • Currently, the program does not check whether the a key is co-prime with 26. If a is not co-prime with 26, the decryption will fail, as a modular inverse will not exist. An attacker can use this to cause denial of service by providing keys that don't have modular inverses, causing the decryption function to fail. This is not exactly an attack to break the cipher, but an exploitation of a weakness in the implementation to possibly cause service disruptions.
  1. Timing Attack:
  • Though somewhat theoretical and less practical in this context, attackers might attempt to use the timing information (how long it takes to encrypt or decrypt a message) to find information about the keys, especially since the modular inverse function uses a loop that can take different amounts of time depending on the input.

To mitigate these two attack vectors, we might consider adding more robust input validation (such as checking whether a is co-prime with 26) and possibly considering ways to make the encryption and decryption times more consistent to prevent 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