I want to override/extend Mage_Core_Encryption_Model to handle Legacy Passwords.
I’m migrating old sites data into magento. My old site encryption method is Sha-1. but magento use md5 + text in core encryption method. I have changed the core module manually and migrate correctly but now i want to create a custom module for that (migrate without encryption, after migration override the md5 method by sha-1)
How can I create a custom module for that that overwrites the core code I have changed?
If I understand correctly, you need a module to replace the md5 hash mechanism in Magento with sha1?
I wont go into creating an entire module here, but simply the key parts. If you are interested though as a complete example to reference, I created a module a while back which replaces the md5 hash with sha512 that you can look at – https://github.com/drewhunter/BetterHash – you would obviously need to slightly modify it to handle sha1)
So essentially you need to override the hash() method of
Mage_Core_Model_EncryptionYour modules config.xml will require the following:
File: app/code/local/Yourcompany/Yourmodule/etc/config.xml
Then to take advantage of the rewrite:
File: app/code/local/Yourcompany/Yourmodule/Model/Hash.php