Excellent observations, guys.
I was worried about the double-quote thing myself, and it's possible I erred on how I'm entering them into the router before I read them back, which is via a telnet command interface that uses commands of the form
conf set foo bar
to enter plain-text values, or
conf set_obscure foo bar
to enter values encoded using this algorithm.
The telnet command interface uses quotes to represent string values, so
conf set foo "bar"
sets foo to bar, not "bar" with the quotes embedded.
Because of this, I need to escape the quotes when I enter them in the interface. Backslash does appear to be the correct character to use for escaping quotes, as:
conf set foo \"
sets foo to &22; which is the right hex code for a double-quote. Same for the single-quote (&27;).
Here's what I'm doing to handle these in my script:
def get(s1):
s1 = s1.replace("'", "\\'")
s1 = s1.replace('"', '\\"')
print s1
conn.send_command("conf set_obscure foo %s" %(s1))
s2 = conn.get_config("foo")['/foo']
s3 = pwdecode3(s1, s2)
return [ s2, s3 ]
I'll try doing the mod 255 offset 1 thing.
Bitt, Here's the output you asked for:
aaaaaa &b7;UP&b1;&95;&0b; 56f4ef5034aa
"aaaaa xUP&b1;&95;&0b; 1c33ef5034aa
So, yeah, something funky going on with the quotes.