Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

ZioNN

Criptografia segura

Recommended Posts

Pessoal,

 

Estou precisando de um script asp para criptografia de strings, que criptografe e descriptografe, usando uma chave privada escolhida por mim, e que seja realmente seguro.

 

Não serve nenhum dos modelos que estão no laboratório de scripts deste forum.

 

Já fiz uma boa pesquisa no google e só encontrei scripts básicos ou com problemas na geração dos keys. As melhores soluções são componentes pagos que eu não tenho como instalar no servidor (compartilhado).

 

Alguém tem alguma sugestão?

 

Grande abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

Já tentou usar MD5?

 

Mas não tem como discriptografar, o fato é que ele lê criptografado e e grava criptografado.

É um script muito usado por programadores asp.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Sim, já usei, mas não é adequado para o que eu preciso. De qqer forma, obrigado pela ajuda.

Compartilhar este post


Link para o post
Compartilhar em outros sites

você pode desenvolver uma DLL para esse fim , você tentou usar

Criptografia DES 3 128 bits, e tem alguns componetes mais acessiveis.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Valeu brother, mas como mencionei, não tenho acesso ao servidor pois é hospedagem compartilhada. Então não dá pra instalar a dll

Compartilhar este post


Link para o post
Compartilhar em outros sites

tenho varios códigos, vamos ver se esse te ajuda

<%
'### Para criptografar / descriptografar inclua este código em sua página 
'# # # StrMyEncryptedString = EncryptString (strString) 
'# # # StrMyDecryptedString = DeCryptString (strMyEncryptedString) 


Private Function EncryptString(strString)

Dim CharHexSet, intStringLen, strTemp, strRAW, i, intKey, intOffSet
Randomize Timer

intKey = Round((RND * 1000000) + 1000000)   '##### Key Bitsize
intOffSet = Round((RND * 1000000) + 1000000)   '##### KeyOffSet Bitsize

	If IsNull(strString) = False Then
		strRAW = strString
		intStringLen = Len(strRAW)
				
				For i = 0 to intStringLen - 1
					strTemp = Left(strRAW, 1)
					strRAW = Right(strRAW, Len(strRAW) - 1)
					CharHexSet = CharHexSet & Hex(Asc(strTemp) * intKey) & Hex(intKey)
				Next
		
		EncryptString = CharHexSet & "|" & Hex(intOffSet + intKey) & "|" & Hex(intOffSet)
	Else
		EncryptString = ""
	End If
End Function




Private Function DeCryptString(strCryptString)

Dim strRAW, arHexCharSet, i, intKey, intOffSet, strRawKey, strHexCrypData


	strRawKey = Right(strCryptString, Len(strCryptString) - InStr(strCryptString, "|"))
	intOffSet = Right(strRawKey, Len(strRawKey) - InStr(strRawKey,"|"))
	intKey = HexConv(Left(strRawKey, InStr(strRawKey, "|") - 1)) - HexConv(intOffSet)
	strHexCrypData = Left(strCryptString, Len(strCryptString) - (Len(strRawKey) + 1))

	
	arHexCharSet = Split(strHexCrypData, Hex(intKey))
		
		For i=0 to UBound(arHexCharSet)
			strRAW = strRAW & Chr(HexConv(arHexCharSet(i))/intKey)
		Next
		
	DeCryptString = strRAW
End Function



Private Function HexConv(hexVar)
Dim hxx, hxx_var, multiply		
		IF hexVar <> "" THEN
			hexVar = UCASE(hexVar)
			hexVar = StrReverse(hexVar)
			DIM hx()
			REDIM hx(LEN(hexVar))
			hxx = 0
			hxx_var = 0
			FOR hxx = 1 TO LEN(hexVar)
				IF multiply = "" THEN multiply = 1
				hx(hxx) = mid(hexVar,hxx,1)
				hxx_var = (get_hxno(hx(hxx)) * multiply) + hxx_var
				multiply = (multiply * 16)
			NEXT
			hexVar = hxx_var
			HexConv = hexVar
		END IF
End Function
	
Private Function get_hxno(ghx)
		If ghx = "A" Then
			ghx = 10
		ElseIf ghx = "B" Then
			ghx = 11
		ElseIf ghx = "C" Then
			ghx = 12
		ElseIf ghx = "D" Then
			ghx = 13
		ElseIf ghx = "E" Then
			ghx = 14
		ElseIf ghx = "F" Then
			ghx = 15
		End If
		get_hxno = ghx
End Function
	

%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.