Skip to content

Instantly share code, notes, and snippets.

View hongry18's full-sized avatar

hongry hongry18

View GitHub Profile
@hongry18
hongry18 / aes_encrypt.php
Created April 5, 2016 05:21 — forked from kijin/aes_encrypt.php
PHP에서 AES-256과 HMAC을 사용하여 문자열을 암호화하고 위변조를 방지하는 법
<?php
// AES-256과 HMAC을 사용하여 문자열을 암호화하고 위변조를 방지하는 법.
// 비밀번호는 서버만 알고 있어야 한다. 절대 클라이언트에게 전송해서는 안된다.
// PHP 5.2 이상, mcrypt 모듈이 필요하다.
// 문자열을 암호화한다.
function aes_encrypt($plaintext, $password)
{