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

Challenge 43: new challenge for secret shared on social media. #1144

Merged
merged 6 commits into from
Dec 19, 2023

Conversation

djvinnie
Copy link
Contributor

What kind of changes does this PR include?

  • Fixes or refactors
  • A new challenge
  • Additional documentation
  • Something else

Description

Added new challenge according to documentation.

Relations

Relates #616

References

Screenshot 2023-12-13 at 19 52 51

Checklist:

  • All the contributions made are solely the work of me and my co-authors
  • I tested the changes in this PR (if applicable)
  • I added unit tests to ensure my change works (when change in Java or on front-end code)
  • I added UI tests to ensure my UI changes work (when change in the overall UI, not needed if just adding a challenge)
  • The PR passes pre-commit hooks and automated tests

Copy link
Collaborator

@commjoen commjoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @djvinnie ! Awesome to see your first challenge!
Sorry to make it a liiitle bit harder to finish it as, looking at the challenge in its first complete version, the link to the microsoft golden key blunder feels a bit weak.. @bendehaan what do you think of the alternative text?

Comment on lines 11 to 25
private final String secretKey = new String(Hex.decode("4348524953544D4153324B3233"));

@Test
void spoilerShouldRevealAnswer() {
var challenge = new Challenge43();

assertThat(challenge.spoiler()).isEqualTo(new Spoiler(secretKey));
}

@Test
void rightAnswerShouldSolveChallenge() {
var challenge = new Challenge43();

assertThat(challenge.answerCorrect(secretKey)).isTrue();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we, instead of giving a hint about the secret, just say the following please?:

Suggested change
private final String secretKey = new String(Hex.decode("4348524953544D4153324B3233"));
@Test
void spoilerShouldRevealAnswer() {
var challenge = new Challenge43();
assertThat(challenge.spoiler()).isEqualTo(new Spoiler(secretKey));
}
@Test
void rightAnswerShouldSolveChallenge() {
var challenge = new Challenge43();
assertThat(challenge.answerCorrect(secretKey)).isTrue();
}
@Test
void rightAnswerShouldSolveChallenge() {
var challenge = new Challenge43();
assertThat(challenge.answerCorrect(challenge.spoiler())).isTrue();
}

src/main/resources/explanations/challenge43.adoc Outdated Show resolved Hide resolved
@djvinnie
Copy link
Contributor Author

Thanks for your comments @commjoen ! I will wait to hear Ben's comments before making the changes you have proposed :)

@commjoen commjoen changed the title Added new challenge for secret shared on social media. Challenge 43: new challenge for secret shared on social media. Dec 17, 2023
Copy link
Collaborator

@commjoen commjoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @djvinnie ! LGTM!

@commjoen commjoen merged commit 9135247 into OWASP:master Dec 19, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants