Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Closed Issue: BlockCipher.Encrypt fails if input message is not padded [2547]

$
0
0
BlockCipher.Encrypt fails if input message length is not a multiple of BlockSize. The error is "Invalid output buffer".

This seems to be due to the following code in EncryptBlock function of BlockCipher class:

var output = new byte[data.Length];

if (data.Length % this._blockSize > 0)
{
if (this._padding == null)
{
throw new ArgumentException("data");
}
data = this._padding.Pad(this._blockSize, data);
}

The size of output array is determined before the padding of input data. As a result, after the padding input array is longer than output array.

The same applies to Decrypt function.
Comments: Fixed in 2014.4.6-beta2.

Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>