tag: java

AES encryption with Java

20 Mar, 2018 - 3 minutes

The following code is for encrypting short messages (it acts on byte arrays and not streams so the whole message needs to fit in memory). It creates a random Initialisation Vector (IV) for each message which is prepended to the start of the encrypted stream.

Minimal logging configuration with Java, SLF4J & Gradle

9 Mar, 2018 - 1 minutes

This is mainly here for my copying and pasting for a new Java project.

The gradle deps bring the SLF4J API in to the compile time classpath and the LOG4J implementation in to the runtime. If you wanted to compile the log4j implementation in to your code base (e.g. building an application and not a library), you would need to move it into the compile list.