The secure computation of the graph structure is an important element in the field of secure calculation of graphs, which is important in querying data in graphs, since there are no algorithms for the graph edit distance problem that can resist attacks by malicious adversaries. In this paper, for the problem of secure computation of similarity edit distance of graphs, firstly, the encoding method applicable to the Paillier encryption algorithm is proposed, and the XOR operation scheme is proposed according to the Paillier homomorphic encryption algorithm. Then, the security algorithm under the semi-honest model is designed, which adopts the new encoding method and the XOR operation scheme. Finally, for the malicious behaviors that may be implemented by malicious participants in the semi-honest algorithm, using the hash function, a algorithm for secure computation of graph editing distance under the malicious model is designed, and the security of the algorithm is proved, and the computational complexity and the communication complexity of the algorithm are analyzed, which is more efficient compared with the existing schemes, and has practical value. The algorithm designed in this paper fills the research gap in the existing literature on the problem of graph edit distance and contributes to solving the problem.