It is impossible to βdecryptβ passwords (at least not in a general, efficient and reliable way), you can guess some passwords that attackers do, and you want to transfer from MD5 precisely because attackers may have some success with it). Thus, migration will spread over time: some passwords will be hashed with MD5, others with SHA-256. When the password is verified:
- If the SHA-256 of this password is known, SHA-256 is used. This password has already been migrated.
- Otherwise, MD5 is used to verify the password. If this matches, then the password is good, and since the application knew the password at that time, the application also hashes the password with SHA-256 and replaces the MD5 hash with the SHA-256 hash in the database.
, ; MD5, / , . MD5 SHA-256, , (16 MD5, 32 SHA-256). .
, - - , MD5 SHA-256, . -, , , . , , "" ( , ) - (.. , , ) -). . . : , bcrypt, SHA-256 (. , security.stackexchange).