Matrix-based security