The real answer is to divide the travelling public into 3 groups. Group 1 are known and trusted identities with a reason to be suspected. they go through security like in pre 9/11 days.
The 2nd group are unknown individuals or known but not trusted. They get the full treatment.
The 3rd group doesn't get to board the plane/train/bus.
Profiling based on religion and national origin is allowed.