@Test public void nonceContainsRandomData() { final Nonce nonce = this.jnacl.randomNonce(); assertThat(nonce.getNonceBytes()).hasSize(24); }
@Override public Nonce randomNonce() { final byte[] nonceBytes = new byte[crypto_secretbox_NONCEBYTES]; this.secureRandom.nextBytes(nonceBytes); final Nonce nonce = new Nonce(nonceBytes); LOGGER.debug("Generated random nonce {}", nonce); return nonce; }
Jnacl implements Encryptor { @Override public Nonce randomNonce() { final byte[] nonceBytes = new byte[crypto_secretbox_NONCEBYTES]; this.secureRandom.nextBytes(nonceBytes); final Nonce nonce = new Nonce(nonceBytes); LOGGER.debug("Generated random nonce {}", nonce); return nonce; } }
Jnacl implements Encryptor { @Override public Nonce randomNonce() { final byte[] nonceBytes = new byte[crypto_secretbox_NONCEBYTES]; this.secureRandom.nextBytes(nonceBytes); final Nonce nonce = new Nonce(nonceBytes); LOGGER.debug("Generated random nonce {}", nonce); return nonce; } Jnacl(final SecureRandom secureRandom, final SecretBox secretBox); }
Jnacl implements Encryptor { @Override public Nonce randomNonce() { final byte[] nonceBytes = new byte[crypto_secretbox_NONCEBYTES]; this.secureRandom.nextBytes(nonceBytes); final Nonce nonce = new Nonce(nonceBytes); LOGGER.debug("Generated random nonce {}", nonce); return nonce; } Jnacl(final SecureRandom secureRandom, final SecretBox secretBox); @Override SharedKey computeSharedKey(final PublicKey publicKey, final PrivateKey privateKey); @Override byte[] seal(
            final byte[] message, final Nonce nonce, final PublicKey publicKey, final PrivateKey privateKey); @Override byte[] open(
            final byte[] cipherText, final Nonce nonce, final PublicKey publicKey, final PrivateKey privateKey); @Override byte[] sealAfterPrecomputation(final byte[] message, final Nonce nonce, final SharedKey sharedKey); @Override byte[] openAfterPrecomputation(final byte[] cipherText, final Nonce nonce, final SharedKey sharedKey); @Override Nonce randomNonce(); @Override KeyPair generateNewKeys(); @Override SharedKey createSingleKey(); }
Jnacl implements Encryptor { @Override public Nonce randomNonce() { final byte[] nonceBytes = new byte[crypto_secretbox_NONCEBYTES]; this.secureRandom.nextBytes(nonceBytes); final Nonce nonce = new Nonce(nonceBytes); LOGGER.debug("Generated random nonce {}", nonce); return nonce; } Jnacl(final SecureRandom secureRandom, final SecretBox secretBox); @Override SharedKey computeSharedKey(final PublicKey publicKey, final PrivateKey privateKey); @Override byte[] seal(
            final byte[] message, final Nonce nonce, final PublicKey publicKey, final PrivateKey privateKey); @Override byte[] open(
            final byte[] cipherText, final Nonce nonce, final PublicKey publicKey, final PrivateKey privateKey); @Override byte[] sealAfterPrecomputation(final byte[] message, final Nonce nonce, final SharedKey sharedKey); @Override byte[] openAfterPrecomputation(final byte[] cipherText, final Nonce nonce, final SharedKey sharedKey); @Override Nonce randomNonce(); @Override KeyPair generateNewKeys(); @Override SharedKey createSingleKey();  }