Version 3 packet decoding (AES192/AES256)

  • AndyDufresne

    AndyDufresne - 2012-04-17

    Thank you for this excellent tool.
    I'm trying to use this library to decode Snmp Version 3 traps and am getting an error when trying to use the library with AES192/AES256 privacy protocols.
    It works fine and is able to decode the packet for other privacy protocols (e.g. DES, 3DES, AES128).
    The error we are getting is around decoding the PDU. Specifically in the library the code in ScopedPdu.cs:
    if (sequenceType != SnmpConstants.SMI_SEQUENCE)
    throw new SnmpDecodingException("Invalid ScopedPdu sequence detected. Invalid ScopedPdu encoding.");

    Any idea what I could be missing/doing wrong as the code seems to work for the other privacy protocols.
    Any help would be greatly appreciated!!!!

  • Nobody/Anonymous


    I've found an issue with extending short keys in AES192/256. I've got a working fix and have done some testing to make sure it works. I'll post a new version of the library in the next couple of days.

    Thanks for reporting the issue.


  • milans

    milans - 2012-04-19

    I've just posted version 0.9.2 that includes the AES192/256 fix. Let me know if you still have problems.

    One quick note, while testing I've noticed that some agent vendors allow passwords (secrets) that are less then 8 characters in length. Specification doesn't allow that so library will raise a secret too short exception if you try.


  • AndyDufresne

    AndyDufresne - 2012-04-30

    Sincere apologies for the delay. I had set the comments to be monitored but didn't get any emails. I just verified the fix. Really appreciate your prompt fix.

    Thanks again!!

  • Scott

    Scott - 2014-08-06

    Still having this problem using version 0-9-4 but I don't understand how to use the PrivacyAES.ExtendShortKey function you added. My code works fine to capture SNMPV3 traps when I send using MD5 AES128 but if I send AES256 I get an exception. How do I utilize PrivacyAES.ExtendShortKey?


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks