On Tue, 2006-03-28 at 09:48 -0500, [EMAIL PROTECTED] wrote:
> I have a Net-SNMP-based application that needs some weak encryption to
> cloak strings from idle viewing (like the conversion of createUser to
> usmUser in /var/net-snmp/snmpd.conf).

"weak" encryption is right!

>                                  I'm hoping that the encoding and
> decoding routines are public enough that I can use them out of the
> Net-SNMP libraries but I'm having trouble finding them.

snmplib/snmpusm.c:usm_save_user():
    read_config_save_octet_string(cptr, (u_char *) user->name,
                                            strlen(user->name) + 1);
    read_config_save_octet_string(cptr, (u_char *) user->secName,
                                            strlen(user->secName) + 1);

snmplib/snmpusm.c:usm_read_user():
    line = read_config_read_octet_string
              line, (u_char **) & user->name,    &len);
    line = read_config_read_octet_string(
              line, (u_char **) & user->secName, &len);


This fields are simply the relevant strings, displayed as hex values
rather than printable characters.   They'll protect you against a
simple "strings" scan, but not much more.

Dave


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to