AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi TCP server with md5 Authentication + 3des crypt
Thema durchsuchen
Ansicht
Themen-Optionen

TCP server with md5 Authentication + 3des crypt

Ein Thema von especta · begonnen am 28. Sep 2009
Antwort Antwort
especta

Registriert seit: 28. Sep 2009
8 Beiträge
 
#1

TCP server with md5 Authentication + 3des crypt

  Alt 28. Sep 2009, 15:09
hi i use OverbyteIcsWSocket + DCPcrypt2

i have try to make TCP server with md5 Authentication + 3des crypt
example:
user name = somtimg
pasword = pass

and
des key = 1020304050607080901011121314

i have got this mesage from client ( Server random key length is 19 and must be 14)

hire is (normal tcp server)
var
MyHostName : AnsiString;
begin
WSocket_gethostname(MyHostName);
Display(' I am "' + String(MyHostName) + '"');
Display(' IP: ' + LocalIPList.Text);
WSocketServer1.SocksUsercode := 'user';
WSocketServer1.SocksPassword := 'pass';
WSocketServer1.Proto := 'tcp'; { Use TCP protocol }
WSocketServer1.Port := '400'; { Use telnet port }
WSocketServer1.Addr := '0.0.0.0'; { Use any interface }
WSocketServer1.ClientClass := TTcpSrvClient; { Use our component }
WSocketServer1.Listen; { Start litening }
Display('Waiting for clients...');

hire is string 3des crypt
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
Cipher: TDCP_3des;
KeyStr: string;
begin
KeyStr:= '';
if InputQuery('Passphrase','Enter passphrase',KeyStr) then // get the passphrase
begin
Cipher:= TDCP_3des.Create(Self);
Cipher.InitStr(KeyStr,TDCP_sha1); // initialize the cipher with a hash of the passphrase
for i:= 0 to Memo1.Lines.Count-1 do // encrypt the contents of the memo
Memo1.Lines[i]:= Cipher.EncryptString(Memo1.Lines[i]);
Cipher.Burn;
Cipher.Free;
end;

Decrypt
procedure TForm1.Button2Click(Sender: TObject);
var
i: integer;
Cipher: TDCP_3des;
KeyStr: string;
begin
KeyStr:= '';
if InputQuery('Passphrase','Enter passphrase',KeyStr) then // get the passphrase
begin
Cipher:= TDCP_3des.Create(Self);
Cipher.InitStr(KeyStr,TDCP_sha1); // initialize the cipher with a hash of the passphrase
for i:= 0 to Memo1.Lines.Count-1 do // decrypt the contents of the memo
Memo1.Lines[i]:= Cipher.DecryptString(Memo1.Lines[i]);
Cipher.Burn;
Cipher.Free;
end;
this work on (3des string crypt )

but i need tcp server crypt/decrypt Big plise small example.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:03 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz