Registriert seit: 11. Mai 2005
Ort: Göppingen
1.238 Beiträge
Delphi 2007 Professional
|
Re: Verschlüsslungstool
26. Nov 2005, 20:47
 hab ich noch nie probiert...
Der Source:
Delphi-Quellcode:
const
hexes:array[0..15] of char=('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
function hextobyte(hex:string):byte;
var
i:integer;
begin
for i:=0 to 15 do
if hexes[i]=hex[1] then
result:=16*i;
for i:=0 to 15 do
if hexes[i]=hex[2] then
result:=result+i;
end;
function bytetohex(b:byte):string;
begin
result:=hexes[b div 16]+hexes[b mod 16];
end;
function encodexor(data,password:string):string;
var
i:integer;
begin
result:='';
for i:=1 to length(data) do
if password='' then
result:=result+bytetohex(byte(data[i]))
else
result:=result+bytetohex(byte(data[i]) xor byte(password[(i mod length(password))]));
end;
function decodexor(data,password:string):string;
var
i:integer;
begin
result:='';
for i:=1 to (length(data) div 2) do
if password='' then
result:=result+char(hextobyte(data[i*2-1]+data[i*2]))
else
result:=result+char(hextobyte(data[i*2-1]+data[i*2]) xor (byte(password[(i mod length(password))])));
end;
Es wird nicht das ganze Passwort ausgegeben sondern nur ein teil.. bei mir jedenfalls
Tobias It's not a bug, it's a feature.
|
|
Zitat
|