### Question:
JavaDeEncryptor implements DeEncryptor { public PrivateBinDataV1 encrypt(String strToEncrypt) throws Exception { byte[] iv = randomInitializationVector(); byte[] salt = generateRandomSalt(); byte[] key = DeEncryptor.generateRandomKey(AES_KEY_LENGTH); SecretKey secretKey = generateDerivedkey(key, salt); Cipher cipher = getCipher(); GCMParameterSpec parameterSpec = new GCMParameterSpec(AUTH_TAG_LENGTH, iv); cipher.init(Cipher.ENCRYPT_MODE, secretKey, parameterSpec); cipher.updateAAD("".getBytes()); byte[] encrypted = cipher.doFinal(strToEncrypt.getBytes()); return new PrivateBinDataV1( Base64.getEncoder().encodeToString(iv), 1, ITERATIONS, AES_KEY_LENGTH, AUTH_TAG_LENGTH, "gcm", "", "aes", Base64.getEncoder().encodeToString(salt), Base64.getEncoder().encodeToString(encrypted), Base64.getEncoder().encodeToString(key)); }  PrivateBinDataV1 encrypt(String strToEncrypt); String decrypt(PrivateBinDataV1 data, String secret64);  }### Answer:
@Test void testEncryption() throws Exception { JavaDeEncryptor sut = new JavaDeEncryptor(); PrivateBinDataV1 data = sut.encrypt("test"); System.out.println(data); }