@Override
  public String encrypt(String clearText) {
    try {
      javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance(CRYPTO_ALGO);
      byte[] iv = new byte[GCM_IV_LENGTH_IN_BYTES];
      new SecureRandom().nextBytes(iv);
      cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, loadSecretFile(), new GCMParameterSpec(GCM_TAG_LENGTH_IN_BITS, iv));
      byte[] encryptedText = cipher.doFinal(clearText.getBytes(StandardCharsets.UTF_8.name()));
      return Base64.encodeBase64String(
        ByteBuffer.allocate(GCM_IV_LENGTH_IN_BYTES + encryptedText.length)
          .put(iv)
          .put(encryptedText)
          .array());
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new IllegalStateException(e);
    }
  }
@Test
  public void encrypt_should_generate_different_value_everytime() throws Exception {
    AesGCMCipher cipher = new AesGCMCipher(pathToSecretKey());

    String encryptedText1 = cipher.encrypt("this is a secret");
    String encryptedText2 = cipher.encrypt("this is a secret");

    assertThat(StringUtils.isNotBlank(encryptedText1)).isTrue();
    assertThat(StringUtils.isNotBlank(encryptedText2)).isTrue();
    assertThat(encryptedText1).isNotEqualTo(encryptedText2);
  }