Totalitarianism is a political system comprising commitment to a single goal, with use of violence by official forces on a large scale, suppression of opposing organizations or movements, and enforcement of total public participation towards the achievement of the single goal. Totalitarian parties gain power by means of ruthlessness, intimidation and disinformation. And they keep power the same way.
In the case of Hitler and Stalin, power was not simply sought for its own sake but in order to accomplish an extremely ambitious political project: the transformation of their own citizenry and the creation of a new world order. Massive terror and numerous crimes against humanity was necessary to purge real and potential enemies of the new order, and intensive indoctrination was necessary to fashion a new person. The state became involved in all aspects of a citizen's life. Stalin exterminated friend and foe alike, sending millions of ardent Communists to the gulag, sometimes for no reason whatsoever. In this atmosphere nobody trusted anyone else, and every acquaintance was a suspected police informer. The notion of transformation was even more rigidly applied in Maoist China where thought reform was taken very seriously. All Chinese were supposed to confess to their work units not only counter-revolutionary actions but also counter-revolutionary thoughts, whether their own or those of their relatives and friends.