Text this: A formal approach to the integrated analysis of security and QoS