본문 바로가기
IT/PHP

Mysql 의 Password() 함수로 만든 hash 를 bcrpyt 로 변경해주는 Wordpress plugin

by Spring Up!! 2017. 5. 30.
반응형

옛날 홈페이지를 워드프레스로 이전하는 도중에, 사용자 암호 역시 이전하기 위해 만들었다

이 플러그인은 https://roots.io/plugins/bcrypt-password/ 를 수정해서 만들었다.


Github 에서 원본 소스를 fork 한 git 주소이다

https://github.com/jjjnlove/wp-password-bcrypt/commits/master


옛 홈페이지에서 사용자 비번을 mysql 의 password() 를 사용하여 저장하고 있었다

mysql 개발자 사이트에 가보면 다음과 같은 내용이 있다

PASSWORD() is used by the authentication system in MySQL Server; you shouldnot use it in your own applications. For that purpose, consider a more secure function such as AES_ENCRYPT() or SHA2() instead. Also see RFC 2195, section 2 (Challenge-Response Authentication Mechanism (CRAM)), for more information about handling passwords and authentication securely in your applications.

PASSWORD() 함수는 MySQL 서버의 인증 시스템을 위해 사용하는 것으로, 일반적인 어프리케이션에는 쓰지 말라는 것이다.


그래서 PASSWORD() 로 만든 HASH 값을 BCRYPT 로 변경시키도록 원본 소스에 else if 문을 하나 추가했다

이 플러그인을 사용하는 방법은 wp-password-bcrypt.php 파일을

wp-content/mu-plugins 에 넣으면 된다



반응형

'IT > PHP' 카테고리의 다른 글

CONVERT_TZ : mysql 타임존 변경  (0) 2022.06.16
json_decode 함수 null 반환  (0) 2017.07.25
[PHP] PDO API  (0) 2016.10.22
PHP MySqli 사용 예제  (0) 2016.10.19
PHP Trait  (0) 2016.10.07
PHP list 문  (0) 2016.10.03
Language construct  (0) 2016.09.25
Maria DB Query 사용법 및 기타 주의 사항  (0) 2016.09.12
PHP namespace  (0) 2016.08.21
PHP Array  (0) 2016.08.03

댓글