This documentation is archived and is not being maintained.

SymmetricAlgorithm.BlockSize Property

Gets or sets the block size of the cryptographic operation in bits.

[Visual Basic]
Public Overridable Property BlockSize As Integer
public virtual int BlockSize {get; set;}
public: __property virtual int get_BlockSize();
public: __property virtual void set_BlockSize(int);
public function get BlockSize() : int;
public function set BlockSize(int);

Property Value

The block size in bits.


Exception Type Condition
CryptographicException The block size is invalid.


The block size is the basic unit of data that can be encrypted or decrypted in one operation. Messages longer than the block size are handled as successive blocks; messages shorter than the block size must be padded with extra bits to reach the size of a block. Valid block sizes are determined by the symmetric algorithm used.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

SymmetricAlgorithm Class | SymmetricAlgorithm Members | System.Security.Cryptography Namespace | Cryptographic Services