This is the source code for a CTF challenge. If you want to attempt it yourself, don't read the code or further paragraphs of the README, but go to the challenge. Good luck!
The name "haskell4j" and the accompanying description on the challenge page are chosen humorously. In fact, there is no haskell in this project. The only thing reminding of haskell code is the function composition and currying.
Also humorouly is the author writeup for this challenge titled Handling the Technical Interview.
The main code found in MethodHandleFun.java. It implements an encryption algorithm. The unit tests in MethodHandleFunTest.java are useful to look at, as they implement the straight-forward equivalents of the method handle functions.
To be able to write and test parts of the code separately, they are syntactically split into separate functions. However, before release, everything is inlined using Spoon in SpoonyProcessor.java. For some extra fun this code also implements replacing integer constants with seeded calls to random.
mvn package && java -jar target/method-handles.jar
- A challenge jar named
out.jar
will be created