At present, the mental health of college students has also become an important issue that urgently needs attention under the influence of the surrounding environment. It is coupled with the grim employment situation after graduation and the students’ psychological burden is becoming more and heavier. This paper based on Diffie-Hellman key exchange algorithm studied the effect of psychological stress intervention. First, the Diffie-Hellman key exchange algorithm was analyzed, and then the Diffie-Hellman prediction model was established according to the psychological pressure of college students. Secondly, the simulation test was conducted to compare the simulated results with the original data. The conclusion of the data fitting of the network model training set, verification set and test set were good and the error was very small. Finally, the detailed application of the algorithm and the model were described.