An Architectural Framework for Analyzing Tradeoffs between Software Security and Performance