> Nice shot, thank you!

you are welcome

> Do you know what ExtendShortKey does?

yes, this is the description from the c# lib
Extends the encryption key if key size returned by PasswordToKey is less 
then minimum required by the encryption protocol.

and this is with 3des 32

here is the source from the c# lib

public byte[] ExtendShortKey(byte[] shortKey, byte[] password, byte[] 
engineID, IAuthenticationDigest authProtocol)
{
   int length = shortKey.Length;
   byte[] extendedKey = new byte[MinimumKeyLength];
   Buffer.BlockCopy(shortKey, 0, extendedKey, 0, shortKey.Length);

   while (length < MinimumKeyLength)
   {
     byte[] key =
       authProtocol.PasswordToKey(shortKey, engineID);
       int copyBytes = Math.Min(MaximumKeyLength - length,
         authProtocol.DigestLength);
       Buffer.BlockCopy(key, 0, extendedKey, length, copyBytes);
       length += copyBytes;
   }
   return extendedKey;
}

cheers k1


> 
> 
>> hi everybody,
>> 
>> i found the problem with the 3des encryption
>> i have comparen the snmpsend source code with the snmpsharpnet source
>> code
>> and the problem is in the EncryptPDU
>> branch
>> 
>> this line
>> FPrivKey := Pass2Key( TV3KeyType.PrivKey, FPrivPassword );
>> 
>> gives the same result as the c# library but in the c# library you can
>> see, than when the length of the key is smaler than 32 we have to do
>> another step
>> 
>> in c# its this lines
>> if( encryptionKey.Length < MinimumKeyLength )
>>    encryptionKey = ExtendShortKey(encryptionKey, secret, engineId,
>> authProtocol);
>> 
>> and this step is missing i think in snmpsend and thats why the
>> calculated key is wrong
>> 
>> i will try to imnplement this extra function
>> if someone wants to try, i can offen an open port to a working 3des
>> agent, all the free available 3des agents are also not correct
>> implemented
>> 
>> thanks
>> k1
>> 
>> 
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> synalist-public mailing list
>> synalist-public@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/synalist-public


------------------------------------------------------------------------------
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to