Autor Beitrag
Girgl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Fr 04.06.04 19:00 
Warum kann man keine 2 strings miteinander xor´n?
Bekomme immer
Zitat:
[Error] Unit1.pas(39): Operator not applicable to this operand type

Wie könnte man anders vorgehen um einen Text zu verschlüsseln?
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Fr 04.06.04 19:09 
Girgl hat folgendes geschrieben:
Wie könnte man anders vorgehen um einen Text zu verschlüsseln?

'n Haufen. Wobei xor i.a. eine der schlechtesten sein dürfte (frag Motzi ;-))

Falls du aber mit einem unsicheren xor zufrieden bist, machs so:
text in blöcke (zu 8, 16 bzw 32Bit zerlegen) und dann in byte/word/dword umwandeln und mit dem schlüssel xoren. anschließend wieder zurückkonvertieren.

raziel

_________________
JSXGraph
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Fr 04.06.04 19:12 
wie wandel ich nen string in ein byte/word/dword um?
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Fr 04.06.04 19:21 
in ein byte:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var b: array of byte;
    i: integer;
{...}
setlength(b, length(einstring));
for i := 1 to length(einstring) do
  b[i-1]  := Ord(einstring[i]);


nu haste ein array of byte mit den einzelnen zeichen des strings "einstring".
die kannst der reiche nach xoren und schon hast es verschlüsselt.

raziel

_________________
JSXGraph
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Sa 05.06.04 11:25 
thx
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 05.06.04 11:29 
Aber wie raziel bereits angesprochen hat ist diese Art der Verschlüsselung unsicher und daher nur für Lernzwecke oder kleine Spielerein geeignet... siehe: www.delphi-forum.de/...rder=asc&start=0

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