Hola que version de delphi estas utilizando?
Hice unas pruebas en delphi 2010 y no tuve ningun problema
Código Delphi
[-]function cifrar_Descifrar(const value:string):string;
var
CharIndex:Integer;
begin
Result := Value;
for CharIndex := 1 to Length(Value) do
Result[CharIndex] := chr(not(ord(Value[CharIndex])));
end;
var
msg:string;
begin
msg:='Hello world C';
msg:=cifrar_Descifrar(msg);
Writeln(msg);
msg:=cifrar_Descifrar(msg);
Writeln(msg);
Readln;
end.
Saludos