The present application belongs to the technical field of
information security authentication. Disclosed are a method and
system for managing a
mobile phone token on the basis of an iOS platform, and an electronic device and a storage medium. The method specifically comprises: a
mobile phone end reading a key encrypted by an official website, saving same in a keychain, decrypting the key to obtain a random code associated with a user, and on the basis of the
current time and step size, using an SHA1
algorithm to obtain a dynamic code, wherein the dynamic code is updated every 30 seconds, and if dynamic codes are consistent after comparison, binding is successful; and when the user logs in again, it being necessary to verify the dynamic code to enter a
system in addition to inputting a correct account and a correct
password, and when the
mobile phone end reads the key again, comparing the key with the previous key which is saved in the keychain, and resetting the key into the keychain on the basis of the difference between the two. In the present application, a key is saved in a keychain, so as to avoid
data loss and network impacts, and data in the keychain is not lost when an application is exited and restarted or uninstalled and re-installed, and can be used permanently, such that the problems of existing
short message service verification codes being attacked and cracked can be satisfactorily solved.