Skip to content

An algorithm wirtten purely with Java Method Handles

Notifications You must be signed in to change notification settings

two-heart/haskell4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

haskell4j

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.

Project overview

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.

Build instructions

  1. mvn package && java -jar target/method-handles.jar
  2. A challenge jar named out.jar will be created

About

An algorithm wirtten purely with Java Method Handles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages