The integration of Internet of Things (IoT) with cloud and fog computing makes people’s lives simpler. Resiliency is measured in order to observe how the IoT-cloud-fog environment will cope with the changes when any of the devices is compromised. The blockchain is essentially an append-only data structure that records all the activities in transactions and creates an immutable and distributed ledger of blocks when all participants in the peer-to-peer network agree without requiring trust on a central authority. The chapter discusses the performance evaluation of our proposed model. It emphasizes the need of the blockchain to solve key compromise problem. Using the Balanced Incomplete Block Design (BIBD) model, the keys are generated and efficiency of the network is evaluated. BIBD key generation is done using JMP tool and imported into python for key distribution and gateway selection. To overcome this problem, we deployed a blockchain-based solution to protect the compromised node, which is not achievable using the BIBD model.