Retrieving data from an encrypted text file?
- by user
Let's say I have a text file contains my data.
data :
ab
bc
de
-
encrypted data on text file :
ba
cb
ed
I want to find bc from text file, so I have to decrypt the text file with this code :
SL:=TStringList.create;
SL.LoadFromFile(textfile)
SLtemp:=TStringList.create;
for I := 0 to SL.Count - 1 do
SLtemp.Add(ReverseString(SL[i])); //decrypt
SL.Free;
for I := 0 to SLtemp.Count - 1 do
if SLtemp[i] = 'bc' then
begin
showmessage('found');
break;
end;
SLtemp.Free;
I think my way is wasting resources. I have to load whole file to memory and decrypt them. I need some suggestions here to find quickly a specific line from an encrypted text.
Thanks.