조회 : 206
ㅜㅜ 안녕하세요 ..
일단 초면에 급히 물어봐서 실례많겠습니다...
다름아닌 실명인증 서비스 연동하는데 ㅜㅜ 값이 제대로 넘어오질못해서 ... 이렇게 올립니다..
input.php
<?
/************************************************************************************/
/* - 결과값 복호화를 위해 IV 값을 Random하게 생성함.(반드시 필요함!!) */
/* - input박스 reqNum의 value값을 echo $CurTime.$RandNo 형태로 지정 */
/************************************************************************************/
$CurTime = date(YmdHis); //현재 시각 구하기
//6자리 랜덤값 생성
$RandNo = rand(100000, 999999);
?>
<html>
<head>
<title> 실명확인서비스 </title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<style>
<!--
body,p,ol,ul,td
{
font-family: 굴림;
font-size: 12px;
}
a:link { size:9px;color:#000000;text-decoration: none; line-height: 12px}
a:visited { size:9px;color:#555555;text-decoration: none; line-height: 12px}
a:hover { color:#ff9900;text-decoration: none; line-height: 12px}
.style1 {
color: #6b902a;
font-weight: bold;
}
.style2 {
color: #666666
}
.style3 {
color: #3b5d00;
font-weight: bold;
}
-->
</style>
</head>
<body>
<center>
<br><br><br>
<span class="style1"> 실명확인서비스 </span><br>
<form name="reqCBAForm" method="post" action="http://www.jtv.co.kr/2011/modules/silmyung/name_sample_seed.php">
<input type="hidden" name="retUrl" size="41" value="http://www.jtv.co.kr/2011/modules/silmyung/name_result_seed.php">
<table cellpadding=1 cellspacing=1>
<tr>
<td align=center>주민번호1</td>
<td align=left><input type="text" name="jumin1" size='41' maxlength ='6' value=""></td>
</tr>
<tr>
<td align=center>주민번호2</td>
<td align=left><input type="text" name="jumin2" size='41' maxlength ='7' value=""></td>
</tr>
<tr>
<td align=center>성명</td>
<td align=left><input type="text" name="name" size="40" value=""></td>
</tr>
</table>
<br><br>
<input type="submit" value="실명확인 테스트">
</form>
</center>
</body>
</html>
////////
<?
$CurTime = date(YmdHis);
$RandNo = rand(100000, 999999);
$id = $_REQUEST['id'];
$srvNo =$_REQUEST['srvNo'];
$reqNum =$CurTime.$RandNo;
$jumin1 = $_REQUEST['jumin1'];
$jumin2 = $_REQUEST['jumin2'];
$name = $_REQUEST['name'];
$retUrl = $_REQUEST['retUrl'];
$actionUrl = "https://name.siren24.com/servlet/name_check_seed";
/************************************************************************************/
/* reqNum 값은 최종 결과값 복호화를 위한 SecuKey로 활용 되므로 중요합니다. */
/* reqNum 은 실명 확인 요청시 항상 새로운 값으로 중복 되지 않게 생성 해야 합니다. */
/* 쿠키 또는 Session및 기타 방법을 사용해서 reqNum 값을 */
/* name_result_seed.php에서 가져 올 수 있도록 해야 함. */
/* 샘플을 위해서 쿠키를 사용한 것이므로 참고 하시길 바랍니다. */
/************************************************************************************/
//01. reqNum 쿠키 생성
//01. reqNum 쿠키 생성
setcookie("REQNUM", $reqNum, 0,"/");
//include "function.php";
//$name = Decode($name,$cryptKey);
$exVar = "0000000000000000"; // 확장임시 필드입니다. 수정하지 마세요..
//$name = iconv( "UTF-8","euc-kr",$_REQUEST['name']);
include "function.php";
$name = Encode($name,$cryptKey);
$jumin1 = iconv( "UTF-8","euc-kr",$_REQUEST['jumin1']);
//02. 암호화 파라미터 생성
$reqInfo = $id . "/" . $jumin1 . "/" . $jumin2 . "/" . $name . "/" . $reqNum . "/" . $srvNo . "////" . $exVar;
echo $reqInfo;
//03. 실명확인 요청정보 1차암호화
$iv = "";
$enc_reqInfo = exec("./SciSecuX SEED 1 0 '$reqInfo' ");
//04. 요청정보 위변조검증값 생성
$hmac_str = exec("./SciSecuX HMAC 1 0 $enc_reqInfo ");
//05. 요청정보 2차암호화
//데이터 생성 규칙 : "요청정보 1차 암호화/위변조검증값/암복화 확장 변수"
$enc_reqInfo = $enc_reqInfo. "/" .$hmac_str. "/" ."0000000000000000";
$enc_reqInfo = exec("./SciSecuX SEED 1 0 $enc_reqInfo ");
// echo $enc_reqInfo;exit;
if(substr($jumin2,0,1)=="5" || substr($jumin2,0,1)=="6" || substr($jumin2,0,1)=="7" || substr($jumin2,0,1)=="8"){
$actionUrl = "https://name.siren24.com/servlet/foreign_name_check_seed";
}
?>
<html>
<head>
<title>실명확인 서비스 Sample 화면[Test]</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<style>
<!--
body,p,ol,ul,td
{
font-family: 굴림;
font-size: 12px;
}
a:link { size:9px;color:#000000;text-decoration: none; line-height: 12px}
a:visited { size:9px;color:#555555;text-decoration: none; line-height: 12px}
a:hover { color:#ff9900;text-decoration: none; line-height: 12px}
.style1 {
color: #6b902a;
font-weight: bold;
}
.style2 {
color: #666666
}
.style3 {
color: #3b5d00;
font-weight: bold;
}
-->
</style>
</head>
<body>
<center>
<br><br><br><br><br><br>
<span class="style1">실명확인서비스 요청화면 Sample입니다.</span><br>
<br><br>
<table cellpadding=1 cellspacing=1>
<tr>
<td align=center>회원사아이디</td>
<td align=left><? echo "$id" ?></td>
</tr>
<tr>
<td align=center>서비스번호</td>
<td align=left><? echo "$srvNo" ?></td>
</tr>
<tr>
<td align=center>요청번호</td>
<td align=left><? echo "$reqNum" ?></td>
</tr>
<tr>
<td align=center>주민번호1</td>
<td align=left><? echo "$jumin1" ?></td>
</tr>
<tr>
<td align=center>주민번호2</td>
<td align=left><? echo "$jumin2" ?></td>
</tr>
<tr>
<td align=center>성명</td>
<td align=left><? echo "$name" ?></td>
</tr>
<tr>
<td align=center> </td>
<td align=left> </td>
</tr>
<tr width=100>
<td align=center>요청정보(암호화)</td>
<td align=left>
<?
$enc_reqInfo1 = substr($enc_reqInfo,0,50);
echo $enc_reqInfo1;
?>...
</td>
</tr>
<tr>
<td align=center>결과수신URL</td>
<td align=left><? echo "$retUrl" ?></td>
</tr>
</table>
<!-- 실명확인서비스 요청 form --------------------------->
<form name="reqCBAForm" method="post" action="<? echo "$actionUrl" ?>">
<input type="hidden" name="reqInfo" value = "<? echo "$enc_reqInfo" ?>">
<input type="hidden" name="ok_url" value = "<? echo "name_result_seed.php" ?>">
<input type="submit" value="실명확인서비스 요청">
</form>
</center>
</BODY>
</HTML>
//////
/************************************************************************************/
/* - sample 페이지에서 요청 시 쿠키에 저장한 Reqnum값을 가져와서 IV값에 셋팅 */
/* - 쿠키 만료시간 경과 후 결과처리 못함 */
/************************************************************************************/
//01. 쿠키값 확인
$iv = "";
if (isset($_COOKIE["REQNUM"])) {
$iv = $_COOKIE["REQNUM"];
//쿠키 삭제
setcookie("REQNUM", "", time()-600);
} else {
?>
<script language=javascript>
alert("세션이 만료되었습니다.!!");
return;
</script>
<?
}
// 파라메터로 받은 요청결과
$enc_retInfo = $_REQUEST["retInfo"];
//02. 요청결과 복호화
$dec_retInfo = exec("./SciSecuX SEED 2 0 $iv $enc_retInfo ");
//데이터 조합 : "실명확인1차암호화값/위변조검증값/암복화확장변수"
$totInfo = split("/", $dec_retInfo);
$encPara = $totInfo[0]; //실명확인1차암호화값
$encMsg = $totInfo[1]; //암호화된 통합 파라미터의 위변조검증값
echo $encPara;
//03. 위변조검증값 생성
$hmac_str = exec("./SciSecuX HMAC 1 0 $encPara ");
//04. 실명확인1차암호화값 복호화
$decPara = exec("./SciSecuX SEED 2 0 $iv $encPara ");
//05. 파라미터 분리
$split_dec_retInfo = split("/", $decPara);
print_r($split_dec_retInfo);
$reqNum = $split_dec_retInfo[0]; //요청번호
$jumin1 = $split_dec_retInfo[1]; //주민번호1
$jumin2 = $split_dec_retInfo[2]; //주민번호2
$name = $split_dec_retInfo[3]; //성명
$result = $split_dec_retInfo[4]; //인증결과
$discrHash = $split_dec_retInfo[5]; //중복가입확인정보
$ciscrHash = $split_dec_retInfo[6]; //CI연계값
$ciVersion = $split_dec_retInfo[7]; //ciVersion
$memId = $split_dec_retInfo[8]; //
$encKey = $split_dec_retInfo[9]; //
$mmdd = $split_dec_retInfo[10]; //mmdd
$discrHash = exec("./SciSecuX SEED 2 0 $iv $discrHash "); //암호화된 중복가입확인정보 한번더 복호화
$ciscrHash = exec("./SciSecuX SEED 2 0 $iv $ciscrHash "); //암호화된 CI연계값 한번더 복호화
include "function.php";
$name = Decode($split_dec_retInfo[3],$cryptKey);
?>
<table cellpadding=1 cellspacing=1>
<tr>
<td align=left>요청번호</td>
<td align=left><? echo $reqNum ?></td>
</tr>
<tr>
<td align=left>주민번호1</td>
<td align=left><? echo $jumin1 ?></td>
</tr>
<tr>
<td align=left>주민번호2</td>
<td align=left><? echo $jumin2 ?></td>
</tr>
<tr>
<td align=left>성명</td>
<td align=left><? echo $name ?></td>
</tr>
<tr>
<td align=left>인증성공여부</td>
<td align=left><? echo $result ?></td>
</tr>
<tr>
<td align=left>중복가입확인정보</td>
<td align=left><? echo $discrHash ?></td>
</td>
</tr>
<tr>
<td align=left>CI연계값</td>
<td align=left><? echo $ciscrHash ?></td>
</tr>
<tr>
<td align=left>CI버전</td>
<td align=left><? echo $ciVersion ?></td>
</tr>
<tr>
<td align=left>mmdd</td>
<td align=left><? echo $mmdd ?></td>
</tr>
</table>
////
소스가 기네요;;
저런 순서대로 지금 페이지 진행이 되는데 ... 마지막 부분에 05. 파라미터 분리를 하는데 .. 배열값이 계속 다른건 왜그럴까요..
제목 | 작성자 | 날짜 |
---|---|---|
공대여자 | ||
mins | ||
전문대여자 | ||
공대여자하앜 | ||
신이섭 | ||
정보보안 | ||
정보보안 | ||
ㅅㅅㅅㅅ
S
|
test | |
김호영 | ||
블링규 | ||
공주네 | ||
퍼그씨 |