#1 Re: mORMot 1 » AESAbstract.SimpleEncryptFile access violation » 2018-08-28 14:46:24

Thanks.
I did read your previous answer, but not interprete it correctly.
Now I understand what you meant. Sorry to have disturbed you.
All works fine now.
Merci beaucoup

#2 Re: mORMot 1 » AESAbstract.SimpleEncryptFile access violation » 2018-08-27 20:10:28

-1-
Of course it must be TAESAbstract.
In a previous try-out version I used TAESAbstract and forgot the T here, sorry.
Now the exception is correctly raised.
However: i still receive the exception 'Abstract Error'.

-2-
(below all line numbers are in SynCrypto.pas, version 1.18, July 2018)
TAESAbstract is defined on line 533 of SynScrypto.pas:
  TAESAbstract = class(TSynPersistent)
line 739 defines it's class function SimpleEncryptFile()
lines 12110-12523  gives the details of { TAESAbstract }
line 12487 gives the function i use: class function TAESAbstract.SimpleEncryptFile()

I understand I do not have to initialize AESAbstract as
the function which is encapsulated, class function TAESAbstract.SimpleEncrypt(),
initiates the instance itself.

When I go step by step into TAESbstract.SimpleEncryptFile()
all goes well until, inside TAESAbstract.EncryptPKCS7Buffer()
line 12264 is reached: Encrypt(Output,Output,InputLen+padding);
Stepping inside Encrypt results in procedure _AbstractError

Maybe this is caused by the fact that
line 591 defines: procedure Encrypt(BufIn, BufOut: pointer; Count: cardinal); virtual; abstract;
but the details of TAESAbstract.Encrypt() itself are not given.
I could not find this procedure/method in Delphi itself either.

Please help me a step further.
Thank you in advance.

#3 mORMot 1 » AESAbstract.SimpleEncryptFile access violation » 2018-08-26 22:58:04

Albert43
Replies: 4

Using Delphi 10.1 Berlin and
mORMot-master (version 1.18, July 2018):
  SynCommons.pas
  SynCrypto.pas
  SynLZ.pas.

-----------------
procedure TForm1.bnEncrypt1Click(Sender: TObject);
var Key:RawUTF8;
begin
  Key:=StringToUTF8('ThisIsAsimplePassword');
  try
    if AESAbstract.SimpleEncryptFile(ed1.Text,ed2.Text,Key,true) then showmessage('1 OK') else showmessage('1 Error');

    // Using win32 platform this results in 'Debugger Exception notification':
    //   'Project Project1.exe raised exception class $C0000005 with message 'access violation at 0x006288ff: read of address 0x00000000'
    // Using 'Continue' results in a Project1 message:
    //   'Access violation at address 006288ff in module 'Project.exe'. Read of address 00000000'
    // Using win64 platform similar messages.

  except
    on E:Exception do showmessage(E.message);

      // However: no such exception is raised...
  end;
end;
------------------------------------------------------------------------
The problems encountered are described in the lines with double shashes.

Please help: what did i do wrong?
Thanks!

Board footer

Powered by FluxBB