feat(challenge): add Challenge 63 hardcoded AES encryption key#2492
Open
moeedrehman135 wants to merge 3 commits intoOWASP:masterfrom
Open
feat(challenge): add Challenge 63 hardcoded AES encryption key#2492moeedrehman135 wants to merge 3 commits intoOWASP:masterfrom
moeedrehman135 wants to merge 3 commits intoOWASP:masterfrom
Conversation
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
src/main/java/org/owasp/wrongsecrets/challenges/docker/challenge63/Challenge63.java
Fixed
Show fixed
Hide fixed
| byte[] cipherBytes = Base64.getDecoder().decode(CIPHERTEXT); | ||
| SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES"); | ||
| IvParameterSpec ivSpec = new IvParameterSpec(ivBytes); | ||
| Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); |
Author
There was a problem hiding this comment.
Intentional use for educational purposes - demonstrates padding oracle vulnerability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of changes does this PR include?
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 ciphertextchallenge63.adoc— challenge descriptionchallenge63_hint.adoc— step-by-step hint for playerschallenge63_reason.adoc— explanation of why this is dangerouswrong-secrets-configuration.yamlunder crypto categoryTesting:
Closes #297