Abstract:This paper discusses the theory of 3DES Cryptography algorithm, describes the optimization process of PyDES module, which is a pure python module that implements the DES and Triple-DES algorithms; and analyzes the problems and solutions encountered in the optimization process; Finally, the optimized algorithm was tested by profile which is a tool for python program testing, and the result shows that the optimized algorithm can Enhance the Security and speed of the original algorithm.