¾È±Ô °øºÎ¹æ

ACTIVE SERVER PAGE > °£´ÜÇÑ ¾Ïȣȭ / º¹È£È­ ·ÎÁ÷

µî·ÏÀÏ : 2017-07-04 17:46 Á¶È¸¼ö : 33,818

ASP·Î ¸¸µé¾î º¸´Â °£´ÜÇÑ ¾Ïȣȭ º¹È£È­ ·ÎÁ÷ ÀÔ´Ï´Ù.

ȸ¿øÀÇ ¾ÆÀ̵ð, Æнº¿öµåµîÀ» DB¿¡ ÀúÀåÇÒ ¶§ ¾Ïȣȭ ÇÏ¿© ÀúÀåÀ» ÇÏ°Ô µË´Ï´Ù. ±×¸®°í ȸ¿øÀÌ ·Î±×ÀÎÀ» ÇÏ°Ô µÇ¸é

º¹È£È­ ÇÏ¿© ȸ¿øÀÌ ÀÔ·ÂÇÑ ¹®ÀÚ¿­°ú ºñ±³ÇÏ¿© ·Î±×ÀÎ ¿©ºÎµîÀ» üŷÇÒ¼ö ÀÖ½À´Ï´Ù.
 
Const Ref = "D7EFGBCHL640MN598OIJKPQRSATWXVYZ123U"

	 ' ¾Ïȣȭ
	Function encode(str,chipVal)
			 Dim Temp, TempChar, Conv, Cipher, i : Temp = ""
			 chipVal = CInt(chipVal)
			 str = StringToHex(str)
			 for i = 0 to len(str) - 1
					 TempChar = Mid(str,i+1,1)
					 Conv = InStr(Ref,TempChar)-1
					 Cipher = Conv Xor chipVal
					 Cipher = Mid(Ref,Cipher+1,1)
					 Temp = Temp + Cipher
			 next
			 encode = Temp
	 End Function

	 ' º¹È£È­
	Function decode(str,chipVal)
			 Dim Temp, TempChar, Conv, Cipher, i : Temp = ""
			 chipVal = CInt(chipVal)
			 for i = 0 to len(str) - 1
					 TempChar = Mid(str,i+1,1)
					 Conv = InStr(Ref,TempChar)-1
					 Cipher = Conv Xor chipVal
					 Cipher = Mid(Ref,Cipher+1,1)
					 Temp = Temp + Cipher
			 next
			 Temp = HexToString(Temp)
			 decode = Temp
	 End Function

	 ' ¹®ÀÚ¿­ -> 16Áø¼ö
	Function StringToHex(pStr)
			 dim i, one_hex, retVal
			 for i = 1 to len(pStr)
					 one_hex = hex(asc(mid(pStr,i,1)))
					 retVal = retVal & one_hex
			 next
			 StringToHex = retVal
	 End Function

	 ' 16Áø¼ö -> ¹®ÀÚ¿­
	Function HexToString(pHex)
			 dim one_hex, tmp_hex, i, retVal
			 for i = 1 to len(pHex)
					 one_hex = mid(pHex,i,1)
					 if IsNumeric(one_hex) then
							 tmp_hex = mid(pHex,i,2)
							 i = i + 1
					 else
							 tmp_hex = mid(pHex,i,4)
							 i = i + 3
					 end if
					 retVal = retVal & chr("&H" & tmp_hex)        
			 next
			 HexToString = retVal
	 End Function


	 en1 = encode("761541-5425486   :   ÀÌ»óÇÑ »ç¶÷ÀÌ´Ù.... ¤¾¤¾¤¾¤¾ !@#$%^&*()",2)
	 en2 = decode(en1,2)

	  Response.write en1 &"<br>"& en2



Ȥ½Ã »ç¿ëÇÒ ÀÏÀÌ ÀÖÀ¸½Ã¸é »ç¿ëÇϼ¼¿ä.
 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.