I need to replace some plain text passwords with SHA256 Base64 passwords.
Apparentely the hash generated by the database functions does not match with the ones used by the application. For example: my application uses this function for generating the hash:
$ echo -n "admin" | openssl dgst -sha256 -binary | openssl base64
jGl25bVBBBW96Qi9Te4V37Fnqchz/Eu4qB9vKrRIqRg=
Now, the same password with the database:
select TO_BASE64(SHA2('admin',256));
OGM2OTc2ZTViNTQxMDQxNWJkZTkwOGJkNGRlZTE1ZGZiMTY3YTljODczZmM0YmI4YTgxZjZmMmFiNDQ4YTkxOA==
As you can see it does not match! Any help ?
My DB Version: Server version: 10.0.23-MariaDB MariaDB Server