Take the 2-minute tour ×  Does anyone have a pointer to code (or
just the algorithm) that Cisco uses to generate their password
hashes for things like "enable secret"?  I'm not trying to break
into anything; I'm trying to generate the appropriate "enable
secret" line given a clear text password, not decode an existing
"enable secret" line with a hashed password. I need this for an
automated config-file generator that I'm working on (Netomata
Config Generator).  Basically, what I want is the Cisco
equivalent of the "htpasswd" command used for web servers.  For
example, when I put the following command with clear-text
password into a Cisco config:  enable secret foobar  then when I
do a 'show config' command (assuming I have "service password-
encryption" enabled), what I see is something like this:  enable
secret 5 $1$pdQG$0WzLBXV98voWIUEdIiLm11  I want code that
translates "foobar" to "5 $1$pdQG$0WzLBXV98voWIUEdIiLm11", so
that I can generate the already-hashed passwords in my config-
generation tool, rather th