Skip to content

Instantly share code, notes, and snippets.

@jonathanedgecombe
jonathanedgecombe / keypad.ino
Created November 22, 2017 19:23
Arduino micro keypad
#include <Mouse.h>
#include <Keyboard.h>
#define KEYS 12
#define LEFT_CLICK 0
#define RIGHT_CLICK -1
#define MIDDLE_CLICK -2
int clicks[] = {
@jonathanedgecombe
jonathanedgecombe / EBC.java
Last active December 23, 2015 09:39
EBC (Block Cipher) Implementation
package com.jonathanedgecombe.security;
import java.security.InvalidKeyException;
import java.security.InvalidParameterException;
import javax.crypto.IllegalBlockSizeException;
/**
* EBC (Edgecombe Block Cipher)
* A block cipher making use of substitution, permutation and modular arithmetic.
@jonathanedgecombe
jonathanedgecombe / gist:5584178
Created May 15, 2013 13:57
Simple tool for analyzing compiled Java class files. Code is not neat, this was merely for me to look at the structure of class files in depth before working on a compiler.
package com.jonathanedgecombe.com.bytecode;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@jonathanedgecombe
jonathanedgecombe / gist:5525484
Last active January 22, 2024 12:31
Reverse engineering of the java.util.Random class, finds the seed from the first two consecutive integers generated by a Random.
import java.util.Random;
public class RandomReverse {
public static void main(String[] args) {
Random rng = new Random(1337L);
int i1 = rng.nextInt();
int i2 = rng.nextInt();