Skip to content

Commit

Permalink
Add end message decoding script
Browse files Browse the repository at this point in the history
  • Loading branch information
KostasKoyias committed Oct 24, 2021
1 parent 23a498b commit 92f748e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ is structured.
| 4 | 2 | 15 days | Another friend referral link |
| 5 | 1 | 22 days | - |

>> 1. A referral link allows the person you send it to, to enter foobar.
>> 2. You are asked to fill out your personal info, if you wish, then
> 1. A referral link allows the person you send it to, to enter foobar.
> 2. You are asked to fill out your personal info, if you wish, then
a Google recruiter will contact you soon.

## Challenges
Expand Down Expand Up @@ -80,13 +80,14 @@ is structured.

1. [Expanding Nebula](./src/main/java/foo/bar/l5/readme.txt)(not solved)

>> Note that the *readme* files were slightly simplified
> Note that the *readme* files were slightly simplified
while solving the corresponding challenge.

## Contribute
## End message

You are welcome to fork this repository and submit your own solutions.
Make a pull request and your version will be reviewed within a few days.
After completing all challenges, Google will give you a base64 encoded message.
The key to decode it is your foobar username.
A [script](./scripts/decode.py) was added that prints this message decoded.

## More information

Expand Down
15 changes: 11 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,22 @@ checkstyleTest {
}

repositories {
jcenter()
maven {
url 'https://repo.maven.apache.org/maven2'
name 'Maven Central'
}
}

ext {
junitVersion = "5.8.1"
}

dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:29.0-jre'
implementation 'com.google.guava:guava:31.0.1-jre'
compile group: 'org.openjfx', name: 'javafx', version: '11', ext: 'pom'

// Use JUnit test framework with ParameterizedTest enabled
testCompile 'org.junit.jupiter:junit-jupiter-params:5.7.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
}
12 changes: 12 additions & 0 deletions scripts/decode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/local/bin/python3
"""
Please fill in MESSAGE and KEY as needed
"""
import base64

MESSAGE = "" # base64 encoded message from Google

KEY = "" # Your foobar username, usually your google username camel-cased

result = [chr(ord(c) ^ ord(KEY[i % len(KEY)])) for i, c in enumerate(base64.b64decode(MESSAGE).decode("utf-8"))]
print("".join(result))

0 comments on commit 92f748e

Please sign in to comment.