The invention provides a method and a device for detecting an
encryption algorithm and a secret key. The method comprises the steps of identifying a detected terminal and obtaining the type of the detected terminal and
password equipment used by the detected terminal; determining the detected
algorithm type according to the
password equipment used by the detected terminal; for the detected
algorithm type, selecting a set correlation calculation example to carry out calculation, comparing the detected algorithm type with a
cipher-text generated after the detected terminal carries out
password calculation according to an input
plaintext, and generating the detection result of the detected algorithm type; obtaining the length, the strength, the life cycle and the
interaction protocol of the secret key used by the detected terminal, carrying out password calculation according to the set technical specification, and generating the detection result of the secret key. The method can automatically identify the algorithm used by
terminal equipment, and checks whether the algorithm conforms to the specification of the national password authority, the device is compatible with all types of interfaces, compliance inspection of use of the
encryption algorithm and management of the secret key is carried out on the terminal, and terminals breaking the rule and illegal terminals are prevented from being accessed.