Refactor how ciphers work in order to genericize both the
general Java code, and the init/initiv code paths.