The invention relates to a method for coding and decoding, based on AES algorism. Wherein, it comprises that a, based on the key length, fixing the literate time Nr; b, initializing the data, before first literating the input data, treating it with key operation on it with sub key; c, loading coding or decoding control signal; d, under the control of coding control signal, the decoding / coding literate complex module processes Nr literate operation for Nr times, and under the control of decoding control signal, said module processes decoding literate for Nr times. The invention also provides a relative decoder or coder, which comprises a decoding / coding literate complex module. The invention has a circuit which can simplify the AES algorism, with low power consumption and cost.