cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
162
Views
1
Helpful
9
Replies

View/change password encryption key

eglinsky2012
Spotlight
Spotlight

I'm trying to copy configuration that contains encrypted passwords from one 9800 WLC to another. The key that was used when encryption was originally setup are unknown. Is there a way to view the key that was used? I read elsewhere that it's stored in nvram, so can it be retrieved?

The second issue is I was testing implementing password encryption in our lab controller. I ran the following command:

9800-Lab(config)#key config-key password encrypt key testing
9800-Lab(config)

Now I'm trying to change the key, but when I do so, it asks for the old key but rejects it for being too short! So even though I know the current key, the length seems to be preventing me from changing it.

9800-Lab(config)#key config-key password encrypt key testing123
Old key: <<I input "testing" here
%% Key length less than 8 chars

9800-Lab#

 

So I suppose the bigger/overall question is, if I don't know the original encryption key (or if the WLC is not accepting the current key as the old key in order to change it), is there another way to clear/change the encryption key?

I've tried "no service password-encryption" and "no password encryption aes", but when doing a show run, the passwords are still Type 8 encrypted....

Also, if I ever can get the encryption keys to match on each WLC, are the encrypted passwords shown in the running configs supposed to match between different WLCs?

9 Replies 9

Use any online password decrypt'

MHM

eglinsky2012
Spotlight
Spotlight

I can't decrypt the password without knowing the encryption key. That's the issue, I set the encryption key and left documentation to see LastPass for the key but I never actually put it in LastPass! Grrr. Is there a way to show the current encryption key being used? @Rich R I think you mentioned a while back in another thread that it's stored in nvram; is there a way to retrieve it?

Share encrypt key let me try convert it to plain text 

MHM

is there a way to retrieve it?
Not that I have heard of but I suppose it would necessarily mean attaching some sort of analyser directly to motherboard or extracting the NVRAM as has been demonstrated on some PC exploits.

Are you implying that the encryption key itself is encrypted when stored in the nvram? 
We don't know.  For obvious reasons all Cisco says is that it is stored "securely" in NVRAM.  But like Flavio I expect it would have some sort of encryption at the very least, which would have to be reversible, but known only to Cisco developers who wrote the code.  It would probably use something fixed to the device (like a serial number or similar but not easy to find like serial number) as a salt.

I've tried "no service password-encryption" and "no password encryption aes", but when doing a show run, the passwords are still Type 8 encrypted....
AES encrypted keys and passwords are type 6. Old Cisco reversible password encryption is type 7.
Types 4, 5, 8 & 9 are hashes not encryptions.  They can be cracked but not decrypted.
4 was proven to be fundamentally insecure, 5 uses MD5 now considered easily crackable, 8 & 9 are the stronger variants of 4 and 5.  Type 8 is hashed using PBKDF2, SHA-256, 80-bit salt, 20,000 iterations. Type 9 uses the SCRYPT hashing algorithm (RFC 7914) 80-bit salt, 16384 iterations.  There's some debate but type 9 is mostly considered best practice for hashes on Cisco IOS although as per below NSA currently recommends type 8.
https://community.cisco.com/t5/networking-knowledge-base/understanding-the-differences-between-the-cisco-password-secret/ta-p/3163238 has more detail.
From https://media.defense.gov/2022/Feb/17/2002940795/-1/-1/1/CSI_CISCO_PASSWORD_TYPES_BEST_PRACTICES_20220217.PDF

RichR_0-1737201983639.png
So even if you knew the AES key that would not help with the type 8 passwords because they are not encrypted with that.
So your only hope for those is a PC with plenty of CPU/GPU and running them against one of the freely available cracking tools (HashCat) to see what possible values come up and you might instantly recognise one of the results.

> 9800-Lab(config)#key config-key password encrypt key testing
> 9800-Lab(config)#key config-key password encrypt key testing123
> Old key: <<I input "testing" here
> %% Key length less than 8 chars
<facepalm> That is just classically incompetent and sloppy coding but I guess we're getting used to seeing that kind of thing - at least now you know minimum length 8 characters <smile>

Also, if I ever can get the encryption keys to match on each WLC, are the encrypted passwords shown in the running configs supposed to match between different WLCs?
I don't think they necessarily look identical when generated on different boxes but you can copy them from one box to another as long as you have used the same master AES key on every box before applying them.  Previously you could apply them before configuring the master key and they would start working as soon as the correct master key was configured (right now VPN keys still work this way) but Cisco have introduced logic (intended to be applied to VPN keys too in near future) that it won't accept an encrypted key unless it can be decrypted with the currently configured AES master key which is why you must configure the AES key before applying the encrypted passwords.

eglinsky2012
Spotlight
Spotlight

@Flavio MirandaI'm not trying to decrypt any passwords. I was responding to @MHM Cisco World. What I want to do is either a) view the encryption key, or b) disable password encryption to return to plain text, then encrypt again with a different encryption key.

Regarding disabling it, as I noted before, when I tried to do so, the passwords were still encrypted in the running-config.

@eglinsky2012 

And how is "view the encryption key" different from decrypt. You need to decrypt in order to "view"

what you want to do is not possible and should not be possible because it would represent a security flaw. You would be hacking the WLC. 

@Flavio MirandaAre you implying that the encryption key itself is encrypted when stored in the nvram? This is news to me.

Thanks for the responses, folks, but it's time for me to open a TAC case. I'll report back if anything comes out of it besides factory reset.

@eglinsky2012 

"Are you implying that the encryption key itself is encrypted when stored in the nvram?"

 Well, I hope so. It would not be a good thing from Cisco to store such critical information in clear text anywhere it would be.

 I agree with you, TAC is a good direction to follow and if you get response please share here. This is not very well documented and it is very interesting topic.

Review Cisco Networking for a $25 gift card