{"id":566,"date":"2012-04-15T22:23:54","date_gmt":"2012-04-15T22:23:54","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=566"},"modified":"2012-04-15T22:24:39","modified_gmt":"2012-04-15T22:24:39","slug":"avoid-mysql-password-function","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/avoid-mysql-password-function\/","title":{"rendered":"Avoid the MySQL password function"},"content":{"rendered":"<p>MySQL offers a convenient method to store user passwords, encrypted in a database table. You use the <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/password-hashing.html\">password function<\/a> both to store a password, and check a plain text string for password matching to authenticate a user.<\/p>\n<p>However, if at any point, you decide to change database systems (to PostGreSQL, SQL Server, Oracle, etc.), you suddenly have a field which is completely unrecognizable to your new database system. I should not speak in absolute terms, I have have not done an acceptable level of research on various DBMS out there. But, suffice to say, it&#39;s certainly not a future-proof method.<\/p>\n<p>It makes considerable more sense to encrypt your passwords using your scripting languages encryption functions, then store the value in a binary field in your database table. In this way, it will be easily portable to another DBMS, or even a different version of your existing DBMS.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL offers a convenient method to store user passwords, encrypted in a database table. You use the password function both to store a password, and&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[41],"tags":[88],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/566"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=566"}],"version-history":[{"count":2,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/566\/revisions"}],"predecessor-version":[{"id":568,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/566\/revisions\/568"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}