assertTrue("failed to decrypt ciphertext", Arrays.equals(message, expectedMessage));
}
@Test(expected = RuntimeException.class)
public void testDecryptCorruptedCipherText() throws Exception {
CryptoBox cryptoBox = new CryptoBox(new PrivateKey(BOB_SECRET_KEY));
byte[] IV = HEX.decode(CRYPTOBOX_IV);
byte[] message = HEX.decode(CRYPTOBOX_MESSAGE);
byte[] ciphertext = cryptoBox.encrypt(IV, message);
ciphertext[23] = ' ';
CryptoBox pandora = new CryptoBox(new PrivateKey(BOB_SECRET_KEY));
pandora.decrypt(IV, ciphertext);
fail("Should raise an exception");
}