Autor Beitrag
TheBlackRave
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Di 11.03.03 19:20 
Wie kann ich einen String mit einem 128 Bit Schlüssel verschlüsseln?
Danke für die Hilfe! :D
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Do 13.03.03 22:29 
Ich gebe zu, ich bin da kein Profi. Willst du wissen, wie man mit XOR verschlüsselt? Oder wie man einen 128-Bit-Schlüssel aus 'nem Passwort ebrechnet? Oder was?

_________________
Life is a bad adventure, but the graphic is really good!
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 13.03.03 22:43 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
Procedure EnDeCrypt(Var InString: String);
Var x: Byte;
Begin
  RandSeed := Length(InString);
  FOR x := 1 To Length(InString) Do
    InString[x] := Chr(Ord(InString[x]) Xor (Random(128) Or 128));
End;


undso rufstdu das auf


ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject);
Var DStr: String;
begin
  DStr := Memo1.Lines.Text;
  EnDeCrypt(Dstr);
  Memo2.Lines.Text := DStr;
end;
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Do 13.03.03 22:53 
Titel: hi
da gibts freie Komponenten für:
hier mal ein Auszug:
Zitat:
Copyright: Hagen Reddmann mailto:HaReddmann@AOL.COM
Author: Hagen Reddmann
Remarks: freeware, shareware
Description: Delphi Encryption Compendium Part I-III

D2-D5, BCB3-4

DEC Part I -----------------------------------------------

Status: Freeware, Version 3.0
Description: Includes variuos basicly Algorithm:

5 Checksum: CRC32, XOR32bit, XOR16bit, CRC16-CCITT, CRC16-Standard

23 Hash: MD4, MD5, SHA (other Name SHS), SHA1,
RipeMD128, RipeMD160, RipeMD256, RipeMD320,
Haval (128, 160, 192, 224, 256) with Rounds,
Snefru, Square, Tiger
Sapphire II (128, 160, 192, 224, 256, 288, 320)


40 Cipher: Gost, Cast128, Cast256, Blowfish, IDEA
Mars, Misty 1, RC2, RC4, RC5, RC6, FROG, Rijndael,
SAFER, SAFER-K40, SAFER-SK40,SAFER-K64, SAFER-SK64,
SAFER-K128, SAFER-SK128, TEA, TEAN, Skipjack, SCOP,
Q128, 3Way, Twofish, Shark, Square, Single DES, Double DES,
Triple DES, Double DES16, Triple DES16, TripleDES24,
DESX, NewDES, Diamond II, Diamond II Lite, Sapphire II

2 RNG: Standard Random Generator, Linear Feedback Shift Register RNG with
variable Period from 2^64-1 to 2^2032-1.

6 Text Formats: Hexadecimal, MIME Base 64, Plain, RFC1760 Six Word, UU Coding, XX Coding


others: * Low Level API to access outside from Delphi and BCB
* Fast implementation (i.E. THash_MD4 > 27Mb/sec, TCipher_Blowfish > 8.0 Mb/sec)
* Stringformat Management, includes:
HEX, MIME Base 64, RFC1760 Six Word, UU and XX Coding String converting and Samples
* Designtime Manager Components for Hash's and Cipher's
* Full and easy objectorientated
* RNG's can be cryptographicaly secure
* Standard Cipher Modes:
CBC - Cipher Block Chaining
CTS - Cipher Text Stealing
CFB - Cipher Feedback
OFB - Output Feedback
ECB - Electronic Code Book
CBCMAC - CBC Message Authentication Code
CTSMAC - CTS Message Authentication Code
CFBMAC - CFB Message Authentication Code

einfach mal nach googlen.
grüße
MSCH
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 13.03.03 22:58 
torstenheinze hat folgendes geschrieben:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
Procedure EnDeCrypt(Var InString: String);
Var x: Byte;
Begin
  RandSeed := Length(InString);
  FOR x := 1 To Length(InString) Do
    InString[x] := Chr(Ord(InString[x]) Xor (Random(128) Or 128));
End;


undso rufstdu das auf


ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject);
Var DStr: String;
begin
  DStr := Memo1.Lines.Text;
  EnDeCrypt(Dstr);
  Memo2.Lines.Text := DStr;
end;

Soll das jetzt eine 128-Bit XOR-Verschlüsselung sein?

Schon mal überlegt, was passiert, wenn bei XOR nicht darstellbare Zeichen rauskommen? :roll:
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Fr 14.03.03 10:53 
Also das mit dem XOR vergesst mal alle ganz schnell wieder. XOR ist eine so simple Verschlüsselung.. die kann problemlos innerhalb von 10min geknack werden (außer in Zusammenhang mit einem OneTimePad).

Wenn du wirklich sicher verschlüsseln willst würde ich das DEC (Delphi Encryption Compendium) von Hagen Reddmann empfehlen (wurde eh schon erwähnt). Das ist das beste mir bekannte Crypto-Package und noch dazu mit Source und frei verfügbar.

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Fr 14.03.03 18:18 
wenn du wirklich sichern verschlüsseln willst, dann würde ich alle verschlüsselungsmethoden, die du finden kannst hintereinanderschalte.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Fr 14.03.03 20:59 
torstenheinze hat folgendes geschrieben:
wenn du wirklich sichern verschlüsseln willst, dann würde ich alle verschlüsselungsmethoden, die du finden kannst hintereinanderschalte.


Sorry, aber dieser Vorschlag ist nicht wirklich sinnvoll! Sofern er bei allen Algos denselben Schlüssel verwendet, so ist die Sicherheit nach einer Verschlüsselung mit 100 Algos genauso hoch wie mit einem Algo, da die gesamte Sicherheit nur von dem einen Passwort abhängt. Verwendet er aber für jeden Algo ein andres Passwort, so wäre es genauso sicher das ganze mit einem Algo und dafür x-mal mit x verschiedenen Passwörtern zu verschlüsseln.

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!