Back to Challenges
Mysterious Song Challenge
You have been given a task to decode the secret message that was found on Eve's machine.
Eve's machine is quite powerful and has more cores (aka processors) than a normal machine.
Apparently, it has as many cores (aka processors) as half of the ASCII number representing space.
Here is the message:
NTc3OTg1MDg0NzI3OTg1NzE3Mjg0MDg5Nzk4NTA2NTgyNjkwNjg3OTc4NjkzMTA1MjcyNjkwNzA4NTc4MDcyNjU4MzA3NDg1ODM4NDA2NjY5NzE4NTc4MTQwMzg3OTc2NzY3OTg3MDg0NzI2OTA3NjczNzg3NTA4NzczODQ3MjA2NTA4MzczODAwNzk3MDA4OTc5ODU4MjA2ODgyNzM3ODc1MjYwNzI4NDg0ODA4MzI2MTUxNTg2NzA3OTgyNjgxNDc3NjkxNTE4MTcyNDIwMTY2NzE3NjUxOTY5MTk2ODY2MjIyNTY5MTYxNzIwMjAyMTY3MjQyMzI0MTg2NTI1MjU3MDI1NjY
We also found the code that Eve used to encode the message but we failed to find a function that can decode it.
Here is the code for encoding:
import java.util.Base64;
public class SuperSecureSecretSocks {
public static String messStuffUp(String input) {
int numberOfCores = Runtime.getRuntime().availableProcessors();
int[] ascii = new int[input.length()];
for (int i = 0; i < input.length(); i++) {
ascii[i] = (int) input.charAt(i);
}
for (int i = 0; i < input.length(); i++) {
ascii[i] = ascii[i] - numberOfCores * 2;
}
String asciiString = "";
for (int i = 0; i < input.length(); i++) {
asciiString += ascii[i];
}
String base64encoded = Base64.getEncoder().withoutPadding().encodeToString(asciiString.getBytes());
return base64encoded;
}
}Challenge Hints
- 🔢 Figure out how many cores Eve's machine has based on the ASCII value hint
- 🔓 The encoding process has three steps - you'll need to reverse them
- 📝 Base64 decode first, then work backwards through the transformations
- 🎵 The final message might reveal something musical...