Method for comparing a first path T with a second path T', the paths T and T' being at least partly included in a geographical area, the geographical area being covered by a set of cells, the method being implemented by a computer and comprising: - determining a first signature vector, Sig(EV), determined by applying a hash function, f, to an encrypted vector, EV, so that at least a k-th component of the first signature vector corresponds to the cipher of the minimum component of a vector resulting from the multiplication of a vector V and of a vector resulting from the application to a vector W = (W m ) m∈[1;n] of a k-th permutation contained in a subset of h elements of the set of permutations of n values, where W m is equal to m and the encrypted vector, EV, being the result of the encryption of the vector V representing the path T, the i-th component V i of the vector V = (V i ) i∈[1,n] being: - of strictly positive real value α, when the path T comprises an i-th transition of a set of n transitions, each transition of the set of transitions representing a transition from one cell of the geographical area to another cell of the geographical area; - of strictly positive real value β with n.α < β, when the path T does not contain the i-th transition of the set of transitions; - comparing Sig(EV) with a second signature vector Sig(EV'), the comparison comprising applying a function D that, with two vectors EU' and EU", associates an encrypted value of d(U',U"), where U' and U" are two vectors and EU' and EU" are the encrypted vectors of U' and U", respectively, and d is a distance, the second signature vector Sig(EV') corresponding to the second path T'. - determining a first signature vector, Sig(EV), determined by applying a hash function, f, to an encrypted vector, EV, so that at least a k-th component of the first signature vector corresponds to the cipher of the minimum component of a vector resulting from the multiplication of a vector V and of a vector resulting from the application to a vector W = (W m ) m∈[1;n] of a k-th permutation contained in a subset of h elements of the set of permutations of n values, where W m is equal to m and the encrypted vector, EV, being the result of the encryption of the vector V representing the path T, the i-th component V i of the vector V = (V i ) i∈[1,n] being: - of strictly positive real value α, when the path T comprises an i-th transition of a set of n transitions, each transition of the set of transitions representing a transition from one cell of the geographical area to another cell of the geographical area; - of strictly positive real value β with n.α < β, when the path T does not contain the i-th transition of the set of transitions; - of strictly positive real value α, when the path T comprises an i-th transition of a set of n transitions, each transition of the set of transitions representing a transition from one cell of the geographical area to another cell of the geographical area; - of strictly positive real value β with n.α < β, when the path T does not contain the i-th transition of the set of transitions; - comparing Sig(EV) with a second signature vector Sig(EV'), the comparison comprising applying a function D that, with two vectors EU' and EU", associates an encrypted value of d(U',U"), where U' and U" are two vectors and EU' and EU" are the encrypted vectors of U' and U", respectively, and d is a distance, the second signature vector Sig(EV') corresponding to the second path T'. <EOS>