To slow down the spread of COVID-19, governments around the world are trying to identify infected people and to contain the virus by enforcing isolation and quarantine. However, it is difficult to trace people who came into contact with an infected person, which causes widespread community transmission and mass infection. To address this problem, we develop an e-government mobile and fog computing framework that can trace positive and suspected cases nationwide. We use personal mobile devices with contact tracing apps and stationary fog nodes, named Automatic Risk Checkers (ARC), to ensure user privacy. Each user’s mobile device receives a Unique Encrypted Reference Code (UERC) when registering on the central application. The mobile device and the central application both generate Rotational Unique Encrypted Reference Code (RUERC) every two hours, and this RUERC is broadcasted using the Bluetooth Low Energy (BLE) technology. Any nearby mobile device can receive the RUERC and record it for the next up to 21 days. As the government maintains the database of server-generated UERCs and contains a mapping between UERC and RUERC, the users’ mobile devices can store the RUERC in the application cache without requiring further encryption. Additionally, if any cases are found, the ARCs broadcast pre-cautionary messages to nearby people without revealing the identity of the infected person. This way, governments can let organizations continue their economic activities without complete lockdown. Further, it becomes viable to identify super spreaders and to map the cluster of infected and suspected cases.