With the continuous development of information technology, online shopping has become a preferred way of shopping by its convenience and rapidity. However, online shopping also brings some hidden dangers to consumers while serving them. The personal information provided by consumers in shopping becomes a commodity and is used by businesses, which seriously threatens the balance of consumers' rights and interests and the market. At present, for many large enterprises, most online shopping data are processed in batches in a unified encryption mode, which leads to an imbalance between efficiency and security. Therefore, this paper proposes a layered encryption model. By adopting different encryption algorithms for various types of data generated in the online shopping process, it can not only improve the efficiency and security of encryption on the premise of ensuring security, but also can guarantee the interests of enterprises and protect the personal information of consumers to the greatest extent. The experiment shows that the simulation results of the model achieve high accuracy under the premise of ensuring data encryption.