Autor Beitrag
henny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 126



BeitragVerfasst: Mi 27.05.09 09:57 
Hallo zusammen,
ich möchte ein programm schreiben das texte(sätze) verschlüsselt
weiß wer wie ich das anstellen könnte?
Danke schonmal im voraus!
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 27.05.09 10:23 
Wo scheitert es konkret?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Mi 27.05.09 10:33 
Naja ich Interpretiere das eher so das er noch garnicht begonnen hat.
Sondern das er erst mal wissen will wie man es überhaupt macht.
Aber ich bin mir sicher "henny" wenn du die Suche benutzt wirst du etwas finden.
blaskito
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63

Win2003, 2008, 2012, WinXP, Win7
Delphi 6 Pers.
BeitragVerfasst: Fr 29.05.09 20:34 
Hi,

ich habe vor einiger Zeit mal was experimentiert. Für einzelne Sätze sollte das reichen. Ich habe aber nie getestet, wie aufwändig ein Knacken des Codes ist.

Gruß aus dem Norden
blaskito

ausblenden volle Höhe Delphi-Quelltext
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:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
function EncodeString(TextString, pwd: string):string;
var
  Zeile,pwdZeile:string;
  i,Anzahl,Zahl,Zufall,pwdZahl:Integer;
begin
  pwdZahl:=GetCheckSum(pwd);
  Randomize;
  Zufall:=Random(223)+32;
  pwdZeile:='';
  Result:='';
  Anzahl:=Length(TextString);
  while Length(pwdZeile)<Anzahl do pwdZeile:=pwdZeile+pwd;
  for i:=1 to Anzahl do begin
    Zahl:=Ord(TextString[i])+Ord(pwdZeile[i])+pwdZahl;
    while Zahl>255 do Zahl:=Zahl-223;
    Zeile:=Zeile+Chr(Zahl);
  end;
  Zeile:=Zeile+Chr(Zufall);
  pwdZeile:=pwdZeile+pwd;
  Anzahl:=Length(Zeile)-1;
  for i:=Anzahl downto 1 do begin
    Zahl:=Ord(Zeile[i])+Ord(pwdZeile[i])+Ord(Zeile[i+1]);
    while Zahl>255 do Zahl:=Zahl-223;
    Zeile[i]:=Chr(Zahl);
  end;
  Result:=Zeile;
end;

function DecodeString(TextString, pwd: string):string;
var
  Zeile,pwdZeile:string;
  i,Anzahl,Zahl,pwdZahl:Integer;
begin
  pwdZahl:=GetCheckSum(pwd);
  pwdZeile:='';
  Result:='';
  Anzahl:=Length(TextString);
  while Length(pwdZeile)<Anzahl do pwdZeile:=pwdZeile+pwd;
  Dec(Anzahl);
  Zeile:='';
  for i:=1 to Anzahl do begin
    Zahl:=Ord(TextString[i])-Ord(pwdZeile[i])-Ord(TextString[i+1]);
    while Zahl<32 do Zahl:=Zahl+223;
    Zeile:=Zeile+Chr(Zahl);
  end;
  Zeile:=LeftStr(Zeile,Anzahl);
  for i:=1 to Anzahl do begin
    Zahl:=Ord(Zeile[i])-Ord(pwdZeile[i])-pwdZahl;
    while Zahl<32 do Zahl:=Zahl+223;
    Zeile[i]:=Chr(Zahl);
  end;
  Result:=Zeile;
end;

function GetCheckSum(TextString: string): LongInt;
var
  i:Integer;
begin
  Result:=0;
  for i:=1 to Length(TextString) do Result:=Result+Ord(TextString[i])
end;