public Optional < byte [ ] > open ( byte [ ] ciphertext ) { if ( ciphertext . length < SecretBox . NONCE_SIZE ) { return Optional . empty ( ) ; } final byte [ ] nonce = Arrays . copyOfRange ( ciphertext , 0 , SecretBox . NONCE_SIZE ) ; final byte [ ] x = Arrays . copyOfRange ( ciphertext , SecretBox . NONCE_SIZE , ciphertext . length ) ; return box . open ( nonce , x ) ; }
Decrypt the ciphertext with the given key .