I propose now to introduce a new class abstract class TPadding and a derived class TPKCS7Padding with the following 3 methods:
Code:
class function AddPadding(const Data: TBytes; BlockSize: integer): TBytes; override;
class function HasValidPadding(const Data: TBytes; BlockSize: integer): boolean; override;
class function RemovePadding(const Data: TBytes; BlockSize: integer): TBytes; override;
These classes will be implemented in the DECCipherBase
unit and can also be used in the future for asymmetric encryption algorithms, if someone is able to implement a modern algorithm post quantum allgorithm.