Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional decode/encode to netutils.password #96

Open
2 of 3 tasks
fischa opened this issue Feb 4, 2022 · 2 comments
Open
2 of 3 tasks

Add additional decode/encode to netutils.password #96

fischa opened this issue Feb 4, 2022 · 2 comments

Comments

@fischa
Copy link

fischa commented Feb 4, 2022

Environment

  • netutils version: future

Proposed Functionality

Being able to use netutils to encode/decode the reversible "hash" format (type 9) for some passwords on Junos. Similar to the Cisco Type 5 and 7 passwords.

E.g. like this

  • netutils.password.decrypt_type9(encrypted_password)
  • netutils.password.encrypt_type9(password, seed)

There is already some translations from the original https://metacpan.org/dist/Crypt-Juniper/view/lib/Crypt/Juniper.pm in Python:

Note: When I read the license of the original Perl module it refers to the same as Perl (which is GPL or the "Artistic License"). Not sure why the 2nd author uses MIT license for his port of it to Python.

Use Case

  • Decoding secrets from existing Junos config to use it as cleartext for another flavour of network operating system. E.g. TACACS password
  • Encoding cleartext secret to type 9 hash for using in Junos config templates. E.g. SNMPv3, BGP, TACACS, etc.
  • Having all tools in a single lib to consume!

If there are questions around this feature request let me know. It's my first contribution to any NetworkToCode repo :)

Maintainers Edit:

List of encode/decode password types:

  • Junos type 9
  • Arista
  • Cisco type 9
@itdependsnetworks
Copy link
Contributor

@itdependsnetworks itdependsnetworks changed the title Add Junos type 9 hash decode/encode to netutils.password Add Junos type 9and Arista hash decode/encode to netutils.password Apr 14, 2022
@fischa
Copy link
Author

fischa commented Apr 22, 2022

The type 9 "hash" is reversible. In the link you have listed the output gives a type 1 hash which should be MD5 if I recall correctly. MD5 is considered insecure but is not that easy to get to the cleartext input. So I'm not sure if the Arista one is a fit for netutils. There are options in passlib to create real hashes too.

@itdependsnetworks itdependsnetworks changed the title Add Junos type 9and Arista hash decode/encode to netutils.password Add additional decode/encode to netutils.password Feb 16, 2023
@abates abates closed this as completed Apr 13, 2023
@abates abates reopened this Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants