X Tutup
The Wayback Machine - https://web.archive.org/web/20201103183956/https://github.com/TheAlgorithms/Java/pull/1600
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

Hacktoberfest: Create a new Encryption Algorithm with AES GCM mode. #1600

Open
wants to merge 5 commits into
base: master
from

Conversation

@fabiopereira96
Copy link

@fabiopereira96 fabiopereira96 commented Oct 4, 2020

Describe your change:

To perform secure encryption, the modes of operation and the fill scheme are essential and must be used correctly according to the encryption algorithm. Most of the available implementations use algorithms with Electronic Codebook (ECB) and this algorithm has vulnerabilities in the reliability of the generated messages that are known to the community.

This example encourages the use of a more complete encryption method than the standard ones.
For block cipher encryption algorithms (like AES), the GCM (Galois Counter Mode) mode, which works internally with zero / no padding scheme, is recommended. At the opposite, these modes and / or schemes are highly discouraged:

  • Electronic Codebook (ECB) mode is vulnerable because it doesn't provide serious message confidentiality: under a given key any given plaintext block always gets encrypted to the same ciphertext block.

  • Cipher Block Chaining (CBC) with PKCS # 5 padding (or PKCS # 7) is susceptible to padding oracle attacks. RSA encryption algorithm should be used with the recommended padding scheme (OAEP)

This issue is describe by SonnarLint in https://community.sonarsource.com/t/java-s5542-has-invalid-compliant-example/21683

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

References

Galois/Counter Mode - https://en.wikipedia.org/wiki/Galois/Counter_Mode
What's the difference between AES-CBC and AES-GCM? - https://www.privateinternetaccess.com/helpdesk/kb/articles/what-s-the-difference-between-aes-cbc-and-aes-gcm
Java AES/GCM/NoPadding - What is cipher.getIV() giving me? - https://stackoverflow.com/questions/31851612/java-aes-gcm-nopadding-what-is-cipher-getiv-giving-me

Checklist:

  • I have read CONTRIBUTING.md.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Java files are placed inside an existing directory.
  • All filenames are in all uppercase characters with no spaces or dashes.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
Fabio Alves Pereira and others added 5 commits Oct 4, 2020
Create a new Encryption Algorithm with AES GCM mode.
Add redirect to new AES Algorithm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.
X Tutup