A method for security encryption of railway signal, characterized in comprising: setting a plurality of security encryption interfaces on a Message Authentication Safety Layer, wherein the plurality of security encryption interfaces respectively correspond to different encryption algorithms; the plurality of security encryption interfaces include a first encryption interface and a second encryption interface, the first encryption interface is connected to a first encryption hardware, the second encryption interface is connected to a second encryption hardware, the first encryption hardware executes DES encryption algorithm, and the second encryption hardware executes SM4 encryption algorithm; selecting one security encryption interface from the plurality of security encryption interfaces; and according to the selected security encryption interface, sending data on the Message Authentication Safety Layer to corresponding encryption hardware via corresponding encryption interface, and the corresponding encryption hardware encrypts data by using the encryption algorithm corresponding to the selected security encryption interface; wherein the method comprises a mode that a data sender and a data receiver negotiate to determine the encryption algorithm, wherein before data encryption, the data sender and the data receiver negotiate the encryption algorithm to be used, and send data to the corresponding encryption hardware via the corresponding encryption interface; if the data receiver considers that the data need to be encrypted by the DES encryption algorithm, the data receiver sends a first encryption selection instruction to the data sender, which instructs the data sender to select the DES encryption algorithm to encrypt the data, after receiving the first encryption selection instruction, the data sender determines to encrypt data on the Message Authentication Safety Layer by using the DES encryption algorithm, an encryption selection module of the data sender sends the data to be encrypted to the fist encryption hardware via the first encryption interface, so that the first encryption hardware executes the DES encryption algorithm and the data sent to the first encryption hardware are encrypted by using the DES encryption algorithm; if the data receiver considers that the data need to be encrypted by SM4, the data receiver sends a second encryption selection instruction to the data sender, which instructs the data sender to select the SM4 encryption algorithm to encrypt the data, after receiving the second encryption selection instruction, the data sender sends J data to be encrypted to the second encryption hardware via the second encryption interface, so that the second encryption hardware executes the SM4 encryption algorithm and the data sent to the second encryption hardware are encrypted by using the SM4 encryption algorithm. setting a plurality of security encryption interfaces on a Message Authentication Safety Layer, wherein the plurality of security encryption interfaces respectively correspond to different encryption algorithms; the plurality of security encryption interfaces include a first encryption interface and a second encryption interface, the first encryption interface is connected to a first encryption hardware, the second encryption interface is connected to a second encryption hardware, the first encryption hardware executes DES encryption algorithm, and the second encryption hardware executes SM4 encryption algorithm; selecting one security encryption interface from the plurality of security encryption interfaces; and according to the selected security encryption interface, sending data on the Message Authentication Safety Layer to corresponding encryption hardware via corresponding encryption interface, and the corresponding encryption hardware encrypts data by using the encryption algorithm corresponding to the selected security encryption interface; wherein the method comprises a mode that a data sender and a data receiver negotiate to determine the encryption algorithm, wherein before data encryption, the data sender and the data receiver negotiate the encryption algorithm to be used, and send data to the corresponding encryption hardware via the corresponding encryption interface; if the data receiver considers that the data need to be encrypted by the DES encryption algorithm, the data receiver sends a first encryption selection instruction to the data sender, which instructs the data sender to select the DES encryption algorithm to encrypt the data, after receiving the first encryption selection instruction, the data sender determines to encrypt data on the Message Authentication Safety Layer by using the DES encryption algorithm, an encryption selection module of the data sender sends the data to be encrypted to the fist encryption hardware via the first encryption interface, so that the first encryption hardware executes the DES encryption algorithm and the data sent to the first encryption hardware are encrypted by using the DES encryption algorithm; if the data receiver considers that the data need to be encrypted by SM4, the data receiver sends a second encryption selection instruction to the data sender, which instructs the data sender to select the SM4 encryption algorithm to encrypt the data, after receiving the second encryption selection instruction, the data sender sends J data to be encrypted to the second encryption hardware via the second encryption interface, so that the second encryption hardware executes the SM4 encryption algorithm and the data sent to the second encryption hardware are encrypted by using the SM4 encryption algorithm.