A method for generating encryption keys and for exchanging the parameters making it possible to generate the keys in a network comprising n entities X wishing to exchange data, the method includes the steps: the n entities elect a common array generator (GM(λ)), at least one of the entities X communicates these values (λi) via several different routing paths Ci, plus a reference random number NX, NY, each entity X, Y generates an array Ts, each entity X, Y composes a secret key based on the generated array (Ts) and based on several values indexed by several pairs ((i,j); (k,l); . . . ; (o,p)) of said array in order to create its secret value, the random number of a first entity X is returned to a second entity Y, one of the n entities X, Y at least compares the consistency of the two values NX after decryption with its own key KXs.