Automatic Enumeration of (Related-key) Differential and Linear Characteristics with Predefined Properties and Its Applications