Skip to content

feat(challenge): add Challenge 63 hardcoded AES encryption key#2492

Open
moeedrehman135 wants to merge 3 commits intoOWASP:masterfrom
moeedrehman135:feat/challenge63-hardcoded-encryption-key
Open

feat(challenge): add Challenge 63 hardcoded AES encryption key#2492
moeedrehman135 wants to merge 3 commits intoOWASP:masterfrom
moeedrehman135:feat/challenge63-hardcoded-encryption-key

Conversation

@moeedrehman135
Copy link
Copy Markdown

What kind of changes does this PR include?

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

Description

Adds Challenge 63 demonstrating bad encryption practices — hardcoding an AES encryption key and IV directly in source code alongside the ciphertext, making the encryption completely ineffective.

Changes:

  • Challenge63.java — AES-CBC decryption with hardcoded key/IV and ciphertext
  • challenge63.adoc — challenge description
  • challenge63_hint.adoc — step-by-step hint for players
  • challenge63_reason.adoc — explanation of why this is dangerous
  • Registered in wrong-secrets-configuration.yaml under crypto category
  • 3 unit tests passing

Testing:

  • Correct answer accepted
  • Wrong answer rejected
  • Spoiler reveals correct answer

Closes #297

Adds a new challenge demonstrating bad encryption practices where
a secret is encrypted with AES-CBC but the key and IV are hardcoded
in the same source file, making the encryption ineffective.
- Add Challenge63.java with hardcoded AES key/IV and ciphertext
- Add explanation, hint, and reason adoc files
- Register in wrong-secrets-configuration.yaml under crypto category
- Add unit tests (3 passing)
Closes OWASP#297
byte[] cipherBytes = Base64.getDecoder().decode(CIPHERTEXT);
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Intentional use for educational purposes - demonstrates padding oracle vulnerability

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.

Add hardcoded encryption key on top of a secret.

2 participants