ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Encrypt complete ImageEn saved file
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Nov 14 2013 :  07:24:03  Show Profile  Reply
I want to Encrypt file save by ImageEn using the function LayersSaveToFile.

How can I do this?

Using this function means ImageEn will save the data of all layers to a custom internal ImageEn format.

TIA




Yogi Yang

fab

1310 Posts

Posted - Nov 27 2013 :  07:55:46  Show Profile  Reply
You could encrypt/decrypt each layer with Proc.Encrypt and Proc.Decrypt. For example:

// encrypt and save
var
  i: integer;
begin
  for i := 0 to ImageEnView1.LayersCount - 1 do
  begin
    ImageEnView1.LayersCurrent := i;
    ImageEnView1.Proc.Encrypt('secret', ieeaTEA2);
  end;
  ImageEnView1.LayersSaveToFile('test.dat');
end;

// load and decrypt
var
  i: integer;
begin
  ImageEnView1.LayersLoadFromFile('test.dat');
  for i := 0 to ImageEnView1.LayersCount - 1 do
  begin
    ImageEnView1.LayersCurrent := i;
    ImageEnView1.Proc.Decrypt('secret', ieeaTEA2);
  end;
end;


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: