new_encrypt($address) ); } elseif($flg==1){//ktai $data = array( 'ktai_address' => new_encrypt($address) ); } elseif($flg==2){//regist $data = array( 'regist_address' => new_encrypt($address) ); } elseif($flg==3){//easy id $data=array('easy_access_id' => new_encrypt($address)); } $where = array('c_member_id' => intval($c_member_id)); return db_update('c_member_secure', $data, $where); } function &get_oldcrypt_blowfish() { static $singleton1; if (empty($singleton1)) { include_once OPENPNE_LIB_DIR . '/include/Crypt/BlowfishOldNOEXT.php'; $singleton1 = new Crypt_BlowfishOld_NOEXT(ENCRYPT_KEY); } return $singleton1; } function &get_newcrypt_blowfish() { static $singleton2; if (empty($singleton2)) { include_once OPENPNE_LIB_DIR . '/include/Crypt/Blowfish.php'; $singleton2 = new Crypt_Blowfish(ENCRYPT_KEY); } return $singleton2; } /** * 可逆的な暗号化をする * * @param string $str 平文 * @return string 暗号文 */ function new_encrypt($str) { if (!$str) return ''; $bf =& get_newcrypt_blowfish(); $str = $bf->encrypt($str); //base64 $str = base64_encode($str); print "$str\n"; return $str; } /** * 可逆的な暗号を復号化する * * @param string $str 暗号文 * @return string 平文 */ function old_decrypt($str) { if (!$str) return ''; //base64 $str = base64_decode($str); $bf =& get_oldcrypt_blowfish(); return rtrim($bf->decrypt($str)); } ?>