code: public final String decryptString(SecretKey sharedKey, byte[] encryptedString) {
          logger.entry();
          try (ByteArrayInputStream input = new ByteArrayInputStream(encryptedString);
                  ByteArrayOutputStream output = new ByteArrayOutputStream()) {
              decryptStream(sharedKey, input, output);
              output.flush();
              String string = output.toString("UTF-8");
              logger.exit();
              return string;
          } catch (IOException e) {
              // should never happen!
              RuntimeException exception = new RuntimeException("An unexpected exception occured while trying to decrypt a string.", e);
              logger.error(exception.toString());
              throw exception;
          }
      }
docs: This method decrypts a string using a shared key.
  
  @param sharedKey The shared key used for the encryption.
  @param encryptedString The encrypted string.
  @return The decrypted string.