Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TEnDeCrypt.EnDecryptFile(pathin, pathout: string; Chave: Word) ;
- var
- InMS, OutMS: TMemoryStream;
- cnt: Integer;
- C: byte;
- begin
- InMS := TMemoryStream.Create;
- OutMS := TMemoryStream.Create;
- try
- InMS.LoadFromFile(pathin) ;
- InMS.Position := 0;
- for cnt := 0 to InMS.Size - 1 do
- begin
- InMS.Read(C, 1) ;
- C := (C xor not (ord(chave shr cnt))) ;
- OutMS.Write(C, 1) ;
- end;
- OutMS.SaveToFile(pathout) ;
- finally
- InMS.Free;
- OutMS.Free;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement