PDA

View Full Version : [VB6]Problems with freddy's decrypt[/VB6]



botmaster
03-03-2007, 06:46 PM
'Aight, so I'm trying to create a proxy with secure authetication. I've already got the components and the code together, however, I always seem to get an error when the server is trying to decrypt the clients authenticication message.

I'm using freddy's encryption algorithm, and it works perfectly. However, I always seem to get a runtime error and I don't know why :(.

Try running the project that I attached, and eventually it will give you an error message.

I'm coding this in VB and not PHP or some easier language because I don't want to intstall WAMP or something like that.

Freddy1990
03-04-2007, 12:03 AM
'Executed by Server to check server's print
Public Function CheckClientFingerPrint(FingerPrint As String) As Boolean
Dim tmp As String
CheckClientFingerPrint = True
tmp = Decrypt(FingerPrint, 5, 45)
tmp = Decrypt(tmp, frmMain.LocalPort, 1001)
If tmp = frmMain.PasswordServer Then
frmMain.txtStatus.Text = frmMain.txtStatus.Text & vbCrLf & "Client fingerprint correct"
SendServerFingerPrint
Else
CheckClientFingerPrint = False
frmMain.netServer.SendData ("Wrong Password")
End If
End Function

'Client sends own print
Public Sub SendClientFingerPrint()
Dim tmp As String
tmp = Encrypt(frmMain.PasswordClient, frmMain.LocalPort, 1001)
tmp = Encrypt(tmp, 5, 43)
frmMain.netClient.SendData (tmp)
frmMain.txtStatus.Text = frmMain.txtStatus.Text & vbCrLf & "Sent client's fingerprint"
End Sub
Hmm, you didn't seem to have used the same keys...
tmp = Decrypt(FingerPrint, 5, 45)
tmp = Encrypt(tmp, 5, 43)

botmaster
03-04-2007, 12:13 AM
My problem is of different nature: try running it, it won't be able to call the chr() in the proc decrypt, so it won't find the ASCII character. I just don't know why. Maybe it's a variable type error?

EDIT: Thanks, that fixed it. I misstyped the key :duh: .

EDIT 2: Now I'm getting another error: client thinks server fingerprint is wrong, wtf i dunno y. Dumb proxy, might as well wait and do it without auth. g2g catch some zzs now, its 2:13 am.