Discuss this help topic in SecureBlackbox Forum


TElSymmetricCrypto     See also     

Filter: C#  VB.NET  Pascal  C++  PHP  Java  

This property specifies the padding mode, used for symmetric encryption or decryption


    TSBSymmetricCipherPadding Padding;

    Property Padding As TSBSymmetricCipherPadding

    property Padding : TSBSymmetricCipherPadding;

    TSBSymmetricCipherPadding get_Padding();
    void set_Padding(TSBSymmetricCipherPadding Value);

    integer get_Padding()
    void set_Padding(integer $Value)

    TSBSymmetricCipherPadding getPadding();
    void setPadding(TSBSymmetricCipherPadding Value);



Use this property to specify the padding mode for the data. When encrypting the data, the encryptor will apply padding to the data. When decrypting the data, padding mode tells the decryptor what mode was actually used during encryption.

Padding is used to completement the data to have length of multiple of the block size. Padding is used for block modes of block encryption algorithms.

Note: Original PKCS#5 padding is defined for 8 byte encryption blocks only. PKCS#7 generalizes the original definition by extending it to support any block size while leaving the padding method itself unchanged. Certain standards therefore refer to the described padding type as 'PKCS#7 padding'. This might be confusing because 'PKCS#5 padding' name is widely used to refer to the same kind of padding (thus de-facto extending the original PKCS#5 declaration beyond the 8 byte block size limitation).

We understand that it is not entirely correct, but we prefer to keep the PKCS#5 naming for backward compatibility with earlier versions of SecureBlackbox and to avoid confusion with other PKCS#7 types. So whenever you are required to support PKCS#7 symmetric cipher padding, use cpPKCS5 type.

See also:     BlockSize    

Discuss this help topic in SecureBlackbox Forum