Homegrown AES implementation (don't use) for security class