In recent years, the Internet of Things (IoT) has been contemplated as the next technological advancement in the era of internet. This paper discloses the architecture of a multilayer, multimode security system for IoT. The proposed system is capable of providing multiple security solutions that support anonymous authentication, device privacy, data integrity, and the detection of device sybil attacks and IoT server spoofing attacks. For IoT access control and authentication, our system can support two modes of operations, one mode endorses protection of device privacy over network, and the second mode relinquishes device identity to establish data tracing during safety critical IoT events. The new security system is incorporated with two crypto approaches, Zero Knowledge Proof (ZKP) and Blockchain. IoT devices anonymity were achieved via multimode ZKP protocol. Data integrity and protection against sybil and IoT spoofing attacks were maintained via blockchain. Our threats analysis models showed that data modification and data injections attacks are not feasible. A probabilistic modeling of IoT spoofing attack was presented in this paper, it shows that our security system provides high resiliency against such attacks with a probability approaching 1.