EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Encryption with TElAESSymmetricCrypto

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#11516
Posted: 10/30/2009 03:36:53
by David MICHEL (Standard support level)
Joined: 09/23/2009
Posts: 48

Hello,

Here my code for encrypt of the data :

Code
Chiffrement := TElAESSymmetricCrypto.Create(SB_ALGORITHM_CNT_AES128,cmCBC);
CleTransact := TElSymmetricKeyMaterial.Create();
try
  try

    //Load key
    fsCleTrans := TFileStream.Create(fCleTrans, fmOpenRead or fmShareDenyWrite);
    try

      SetLength(LoadKey,16);
      fsCleTrans.ReadBuffer(Pointer(LoadKey)^,length(LoadKey));
      CleTransact.Key := LoadKey;

    finally
      FreeAndNil(fsCleTrans);
    end;

    SetLength(IV,16);
    CleTransact.IV := IV;

    Chiffrement.Padding     := cpNone;
    Chiffrement.KeyMaterial := CleTransact;

    fichDataChif := UFonctions.ConstructCheminDest(Copy(fichZip,1,length(fSource)- 6),'_2.chf');

    fsInput := TFileStream.Create(fichZip, fmOpenRead);
    try
      fsOutput := TFileStream.Create(fichDataChif, fmCreate);
      try
        Chiffrement.Encrypt(fsInput, fsOutput);
      finally
        FreeAndNil(fsOutput);
      end;
    finally
      FreeAndNil(fsInput);
    end;

  except
    on E : Exception do begin
      MessageDlg(E.Message, mtError, [mbOk], 0);
      Result := '';
    end;
  end;
finally
  FreeAndNil(CleTransact);
  FreeAndNil(Chiffrement);
  Result := fichDataChif;
end;


I have an error of violation when I for the second time call this function in the same treatment for encrypt another group of data.

Code
Chiffrement.Encrypt(fsInput, fsOutput); //<= Violation


Sincerely yours,
David MICHEL.
#11517
Posted: 10/30/2009 03:45:49
by Eugene Mayevski (EldoS Corp.)

Please assign your license ticket to your user account.


Sincerely yours
Eugene Mayevski
#11518
Posted: 10/30/2009 04:19:48
by David MICHEL (Standard support level)
Joined: 09/23/2009
Posts: 48

I.e., to rest the question with the Standard Support Level account ?


Sincerely yours,
David MICHEL.
#11519
Posted: 10/30/2009 04:38:39
by Eugene Mayevski (EldoS Corp.)

Clients that purchased the license are provided support when they have the license ticket assigned.


Sincerely yours
Eugene Mayevski
#11522
Posted: 10/30/2009 05:58:33
by David MICHEL (Standard support level)
Joined: 09/23/2009
Posts: 48

I have just associated my ticket license on my account.


Sincerely yours,
David MICHEL.
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 1448 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!