패스워드 하실떄 암호화 하실떄 사용하세요 ^^;

function  EnCode($sText,  $sCode)  {  
        $cntData  =  strlen($sText)  -  1;  
        $cntCode  =  strlen($sCode)  -  1;  
          
        $arrData  =  array();  
        $arrCode  =  array();  
          

        for($i  =  0;$cntData  >=  $i;  $i++)  
                $arrData[$i]  =  $sText[$i];  

        for($i  =  0;$cntCode  >=  $i;  $i++)  
                $arrCode[$i]  =  $sCode[$i];  
          
        $flag  =  0;  
        $strResult  =  "";  

        for($i  =  0;$cntData  >=  $i;  $i++)  {  

                $strResult  =  $strResult  .  (ord($arrData[$i])  ^  ord($arrCode[$flag]))  .  chr(8);  

                if($flag  ==  $cntCode)  
                        $flag  =  0;  
                else  
                        $flag++;  
        }  

        return  base64_encode($strResult);  

$testKey  =  "asdjhhjksa";
$decodingData  =  EnCode($pw,  $testKey);
|

댓글 2개

양방향 암호화 함수면서

encode 는 있는데 decode 는 없는 슬픈 현실..
정보 감사합니다
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
12년 전 조회 1,246
12년 전 조회 3,887
12년 전 조회 9,812
12년 전 조회 1,119
12년 전 조회 2,411
12년 전 조회 2,107
12년 전 조회 2,935
12년 전 조회 5,975
12년 전 조회 2,653
13년 전 조회 2,963
13년 전 조회 952
13년 전 조회 4,692
13년 전 조회 1,239
13년 전 조회 2만
13년 전 조회 3,442
13년 전 조회 2,197
13년 전 조회 4,857
13년 전 조회 3,831
13년 전 조회 1,017
13년 전 조회 3,744
13년 전 조회 1,755
13년 전 조회 924
13년 전 조회 2,149
13년 전 조회 7,898
13년 전 조회 1,917