### Question:
JSONEncrypt { public JSONObject decrypt(String key, String json) throws InvalidCipherTextException { return decrypt(key, new JSONObject(json)); } JSONEncrypt(int ks, int iter, int ts);  JSONEncrypt(); JSONObject encrypt(String key, JSONObject blob, String adata); JSONObject decrypt(String key, String json); JSONObject decrypt(String key, JSONObject json);  }### Answer:
@Test public void testDecryption128Macsize() throws JSONException, InvalidCipherTextException, UnsupportedEncodingException { String fixture = "{" + "\"key\" : \"user|pass\", " + "\"raw\":{\"one\":\"two\",\"three\":4}," + "\"encrypted\":" + "{" + "\"iv\":\"lgd/ZDGHEZOnbIXpViykXg==\"," + "\"v\":1," + "\"iter\":1000," + "\"ks\":256," + "\"ts\":128," + "\"mode\":" + "\"ccm\"," + "\"adata\":" + "\"wtf%20bbq%3F\"," + "\"cipher\":\"aes\"," + "\"salt\":\"NFPNycJ3ea0=\"," + "\"ct\":\"GTvZENQJ97HTZp2UvW1C9Bxf7KBVlfKiOaR82njTMk45L/dP+tEG\"" + "}" + "}"; JSONObject parsed = new JSONObject(fixture), raw = parsed.getJSONObject("raw"), encrypted = parsed.getJSONObject("encrypted"), decrypted; int ks = 256, iter = 1000, ts = 128; String key = parsed.getString("key"); JSONEncrypt jsonEncrypt = new JSONEncrypt(ks, iter, ts); decrypted = jsonEncrypt.decrypt(key, encrypted); assertEquals(decrypted.getString("one"), raw.getString("one")); assertEquals(decrypted.getInt("three"), raw.getInt("three")); String adata = URLDecoder.decode(encrypted.getString("adata"), "utf8"); assertEquals(adata, "wtf bbq?"); }