class Jnacl implements Encryptor {

    @Override
    public byte[] open(
            final byte[] cipherText, final Nonce nonce, final PublicKey publicKey, final PrivateKey privateKey) {
        LOGGER.debug(
                "Opening message using nonce {}, public key {} and private key {}",
                nonce,
                publicKey,
                privateKey);

        try {

            final byte[] paddedInput = pad(cipherText, crypto_secretbox_BOXZEROBYTES);

            final NaCl nacl = new NaCl(privateKey.getKeyBytes(), publicKey.getKeyBytes());

            final byte[] plaintext = nacl.decrypt(paddedInput, nonce.getNonceBytes());

            LOGGER.debug(
                "Opened message using nonce {}, public key {} and private key {}",
                nonce,
                publicKey,
                privateKey);

            return plaintext;
        } catch (final Exception ex) {
            throw new EncryptorException(ex.getMessage());
        }
    }

    public  Jnacl(final SecureRandom secureRandom, final SecretBox secretBox);

}