The article deals with ways to quickly change passwords in information ex-change through open space. It suggests an improvement of the Diffie-Hellman algorithm by creating a one-way function on the basis of cellular automata with an extended set of rules. The authors have expanded the rules of the game of life towards definition of the rules of birth rate and life extension, control of the radius of intra-population interaction, rules of death from the age of cells, multi-component (multi-population) system of cells. The created algorithm on the basis of a cellular automaton is used to create keys for safe information transfer. Depending on the needs of encryption, the algorithm can be enhanced by using variable parameters of the cell field and cell behaviour, which will allow to regulate the speed and reliability of encryption. The implementation is in Python and MatLab, which allows to compare results and change the modelling environment when changing the features of the task.