Quelle est la fonction de la commande service password-encryption dans l’iOS Cisco ?


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.

(Les types 1-6 où jamais définis).

Donc, en l'absence du numéro, le mot de passe en clair suit le mot-clé password. service password-encryption convertira n'importe lequel de ceux-ci en mots de passe obfusqués de "type 7". Pour forcer l'utilisation du texte en clair, le "type 0" peut être utilisé.

Maintenant, sachez que le mot de passe "crypté" n'est pas du tout sécurisé. Il y avait un certain nombre de cas d'utilisation qui exigeaient que le système d'exploitation ait accès à un mot de passe en clair, de sorte que le mot de passe obfusqué est facilement inversé. Voir : 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. Les choses qui ont besoin d'accéder à un mot de passe en texte clair ne fonctionneront pas avec cela, mais cela fournit un stockage secret relativement sûr qui peut être piraté avec une attaque par force brute, mais ne peut pas être inversé.