Skip to content

Review of existing Java JDK examples #7

@lisaTeis

Description

@lisaTeis
  1. All class names have the ending "...InOneMethod", may this could be deleted, because only the scenario itself is necessary (Defined example code method like: demonstrate$SCENARIO)

2)Missing in all Java examples (except Symmetric String Encryption (password based)):
Defined example code method like: demonstrate$SCENARIO
Example code method accepts appropriate parameter (usually String).
The example only contains one defined method for the example demonstration AND a main method
Main method calls the demonstrator method with parameter
Return a result depending on the application output

-> At the moment there is no method. Functionality is in the main method.

  1. In all other Java examples it is: plainText.getBytes(StandardCharsets.UTF_8)

In the "Asymmetric String Encryption" it is only:
byte[] cipherTextBytes = cipher.doFinal(plainText.getBytes());
-> Guideline point: "Regarded the encoding of the string" in "Asymmetric encryption" is missing

In the same example the comment (and in "String Signing "):
/* @see https://www.keylength.com/ */
may could be deleted (because of minimality) and because
there is already a reference to this website in the guideline section: "Choosing secure algorithms and concepts"

  1. In example "Asymmetric String Encryption"
    the use-case is missing (Listed use cases for this code example/scenario)

  2. Heading formatted like: $PROGRAMMING_LANGUAGE_NAME $SCENARIO using $LIBRARY_NAME is not correct in: "Password based symmetric file encryption in Java using JDK",
    "Asymmetric String Encryption using Java JDK"

  3. In all examples:
    Heading above code formatted like: Example Code for $HEADING_WITHOUT_USING_LIBRARY using $IMPORTANT_ALGORITHMS_AND_CONCEPTS
    is not in right format at the moment (at least the $HEADING_WITHOUT_USING_LIBRARY part is not similar to the actual heading)

  4. Stated used language versions
    is missing

  5. In example "Symmetric File Encryption"
    The imports may could be minimized:
    import javax.crypto.*;
    import javax.crypto.spec.GCMParameterSpec;
    ...

e.g. javax.crypto.* also contains javax.crypto.spec.GCMParameterSpec, I think

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions