Toon posts:

[ASP] URLencode

Pagina: 1
Acties:

Verwijderd

Topicstarter
Hoe kan ik de querystrings zo coderen, dat ze niet meer herkenbaar zijn en dat ze bij de volgende pagina ook nog goed aankomen? Zie voor voorbeeld http://62.251.28.184/test
Zoals je kunt zien geef ik filenames door in de querystring en die wil ik graag coderen...

Mark.

  • mulder
  • Registratie: Augustus 2001
  • Laatst online: 31-08 15:46

mulder

ik spuug op het trottoir

Zoek maar eens op Base64

oogjes open, snaveltjes dicht


Verwijderd

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
THE TIP OF THE WEEK: ENCODE/DECODE--TWO ROUTINES FOR ASP ENCRYPTION
By Mike Toye (Michael.Toye@bmw.co.uk)



' These two VBScript routines can be use to encrypt data passed on the 
' querystring, 
' so that users can't decode what is being passed between ASP pages.

' USE: sField = Decode(request.querystring(encode("sParm")))

Function Decode(sIn)
    dim x, y, abfrom, abto
    Decode="": ABFrom = ""

    For x = 0 To 25: ABFrom = ABFrom & Chr(65 + x): Next 
    For x = 0 To 25: ABFrom = ABFrom & Chr(97 + x): Next 
    For x = 0 To 9: ABFrom = ABFrom & CStr(x): Next 

    abto = Mid(abfrom, 14, Len(abfrom) - 13) & Left(abfrom, 13)
    For x=1 to Len(sin): y=InStr(abto, Mid(sin, x, 1))
        If y = 0 then
            Decode = Decode & Mid(sin, x, 1)
        Else
            Decode = Decode & Mid(abfrom, y, 1)
        End If
    Next
End Function

' USE: location.href="nextpage.asp?" & encode("sParm=" & sData)

Function Encode(sIn)
    dim x, y, abfrom, abto
    Encode="": ABFrom = ""

    For x = 0 To 25: ABFrom = ABFrom & Chr(65 + x): Next 
    For x = 0 To 25: ABFrom = ABFrom & Chr(97 + x): Next 
    For x = 0 To 9: ABFrom = ABFrom & CStr(x): Next 

    abto = Mid(abfrom, 14, Len(abfrom) - 13) & Left(abfrom, 13)
    For x=1 to Len(sin): y = InStr(abfrom, Mid(sin, x, 1))
        If y = 0 Then
             Encode = Encode & Mid(sin, x, 1)
        Else
             Encode = Encode & Mid(abto, y, 1)
        End If
    Next
End Function

Heb je hier misschien iets aan?
Of anders google je ff op "Querystring+encode"