@Override
	public byte[] encrypt(byte[] message)
	{
		byte[] output = new byte[(int)(Math.ceil(message.length / 3.0) * 4)];

		for(int x = 0, y = 0; x < message.length - message.length % 3; x += 3, y += 4)
		{
			byte a = message[x];
			byte b = message[x + 1];
			byte c = message[x + 2];

			output[y] = (byte)(a >> 2 & 0x3F);
			output[y + 1] = (byte)((a << 4 & 0xF0 | b >> 4 & 0x0F) & 0x3F);
			output[y + 2] = (byte)((b << 2 & 0xFC | c >> 6 & 0x03) & 0x3F);
			output[y + 3] = (byte)(c & 0x3F);
		}
		byte[] newOutput = null;
		switch(message.length % 3)
		{
			case 1:
				newOutput = new byte[output.length - 2];
				System.arraycopy(output, 0, newOutput, 0, newOutput.length);
				output = newOutput;
				output[output.length - 2] = (byte)(message[message.length - 1] >> 2 & 0x3F);
				output[output.length - 1] = (byte)(message[message.length - 1] << 4 & 0xF0 & 0x3F);
				break;
			case 2:
				newOutput = new byte[output.length - 1];
				System.arraycopy(output, 0, newOutput, 0, newOutput.length);
				output = newOutput;
				output[output.length - 3] = (byte)(message[message.length - 2] >> 2 & 0x3F);
				output[output.length - 2] = (byte)((message[message.length - 2] << 4 & 0xF0 | message[message.length - 1] >> 4 & 0x0F) & 0x3F);
				output[output.length - 1] = (byte)(message[message.length - 1] << 2 & 0xFC & 0x3F);
				break;
		}

		return output;
	}