Registriert seit: 31. Aug 2004
Ort: Traiskirchen
575 Beiträge
Turbo Delphi für Win32
|
Re: Dateien verschlüsseln
8. Mai 2005, 18:42
wie wärs mit xor ??
Delphi-Quellcode:
function XORCrypt(Password,InputFilePath,OutputFilePath:String):Boolean;
var aktChar: Integer;
InputFile, OutputFile: File of Byte;
Buffer:Byte;
begin
Result := False;
try
aktChar := 1;
AssignFile(InputFile,InputFilePath);
Reset(InputFile);
AssignFile(OutputFile,OutputFilePath);
Rewrite(OutputFile);
while not Eof(InputFile) do
begin
if(aktChar > Length(Password)) then aktChar := 1;
Read(InputFile,Buffer);
Buffer := Buffer xor ord(Password[aktChar]);
Write(OutputFile,Buffer);
Inc(aktChar);
Application.ProcessMessages;
end;
finally
CloseFile(InputFile);
CloseFile(OutputFile);
Result := True;
end;
end;
|
|
Zitat
|