Java implementation of RNCryptor