The dynamic encryption algorithm is based on the idea of carrying on encryption to the information using dynamic algorithm; it is one kind of algorithm which can produce the stochastic algorithm. The algorithm, may guarantee that the algorithm transforms dynamically using each time, like this caused that the security of the cryptogram system is relied on protection to cryptogram and also carry on the protection to the encryption algorithm. The key length of dynamic encryption algorithm is random, is suitable to carry on the encryption to the random length plaintext, and the encryption speed is quick, the intensity is high, and therefore there is the broad application prospect. This article given one kind of dynamic encryption algorithm models based on the ergodic matrix as well as the concrete realization method, and proves the algorithm security according to the analysis on massive empirical datum.