Qual è la funzione del comando service password-encryption in Cisco iOS?

In Ye Olde Days, the passwords were stored in plain text in the configuration.

  1. user cisco password Cisco123 

This understandably upset some people.

A simple, reversible password “encryption” (really, obfuscation) system was added, but there needed to be a way to tell the command interpreter to convert typed-in passwords to the obfuscated form. That command was service password-encryption.

Now, all plaintext passwords would show up in configuration like this:

  1. user cisco password 7 02250D4808095E731F 

The “7” tells the command prompt that the text following is the “encrypted” form.

If you wanted to FORCE plaintext, even with service password-encryption set, you could use the command

  1. user cisco password 0 Cisco123 

Where the “0” means that unencrypted text follows.

(I tipi 1-6 non sono mai stati definiti).

Quindi, in assenza del numero, la password in chiaro segue la parola chiave password. service password-encryption convertirà qualsiasi di queste in password offuscate di "tipo 7". Per forzare l'uso del testo in chiaro, si può usare il "tipo 0".

Ora, siate consapevoli che la password "criptata" non è affatto sicura. C'è un certo numero di casi d'uso che richiedono che il sistema operativo abbia accesso a una password in chiaro, quindi la password offuscata è facilmente reversibile. Vedi: Cisco Type 7 password tool

The more secure method will use secret instead of password.

  1. username cisco secret Cisco123 

This command will store as something like:

  1. username cisco secret 5 1/.CKS2vYI2haW7YyOBv/ 

which is an irrevesible salted MD5 hash. Le cose che hanno bisogno di accedere a una password in chiaro non funzioneranno con questo, ma fornisce una memorizzazione segreta relativamente sicura che può essere violata con un attacco brute force, ma non può essere invertita.