Hack to make java work crypto magic