A General-purpose security framework