code: public static String encrypt(Key key, String content) throws Exception {
          try {
              Cipher cipher = Cipher.getInstance(CRYPTO_ALGORITHM);
              cipher.init(Cipher.ENCRYPT_MODE, key);
              return Base64.encodeBase64String(cipher.doFinal(content.getBytes()));
          } catch (Exception e) {
              log.error("Error while encrypting", e);
              throw e;
          }
      }
docs: Encrypts the content with the specified key using the default algorithm.
  
  @param key The cryptographic key.
  @param content The content to encrypt.
  @return The encrypted content.
  @throws Exception Unspecified exception.