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 functions for encrypting and decrypting junipter $9$ type passwords #227

Merged
merged 3 commits into from
Apr 27, 2023

Conversation

johanek
Copy link
Contributor

@johanek johanek commented Mar 2, 2023

No description provided.

@johanek johanek force-pushed the feature/juniper-encryption branch 4 times, most recently from 4ffe711 to b0df621 Compare March 2, 2023 13:29
@johanek johanek force-pushed the feature/juniper-encryption branch from b0df621 to 027a2da Compare March 2, 2023 16:16
@itdependsnetworks
Copy link
Contributor

@johanek can you provide the cli showing that this works as expected? It would be great to show doing the same thing as the test shows as well. On our side we will try and do the same.

@johanek
Copy link
Contributor Author

johanek commented Mar 20, 2023

@johanek can you provide the cli showing that this works as expected? It would be great to show doing the same thing as the test shows as well. On our side we will try and do the same.

@itdependsnetworks hey, I'm sorry but I'm not clear what you're asking for. Here's an example of using the functions:

In [1]: from netutils.password import decrypt_juniper, encrypt_juniper

In [3]: encrypt_juniper('mypassword')
Out[3]: '$9$U/jqf9A0OIciku1hcMWjHqfz6CtOEhr'

In [4]: decrypt_juniper('$9$U/jqf9A0OIciku1hcMWjHqfz6CtOEhr')
Out[4]: 'mypassword'

The usage with examples is already in the docstrings for the function. Was there something else you were after?

@itdependsnetworks
Copy link
Contributor

Sorry, just looking for the cli output on the junos side. We had it before (may have even been me :) ) where it didn't actually match what the vendor was doing.

@johanek
Copy link
Contributor Author

johanek commented Mar 20, 2023

# set system radius-server 10.0.0.1 secret RadiusSecret

# show | compare
[edit system radius-server]
+   10.0.0.1 secret "$9$vqY8NVws4GUHX7kPQzAtW8X7-wg4ZDHmX7Hm"; ## SECRET-DATA
In [1]: from netutils.password import decrypt_juniper, encrypt_juniper

In [2]: decrypt_juniper('$9$vqY8NVws4GUHX7kPQzAtW8X7-wg4ZDHmX7Hm')
Out[2]: 'RadiusSecret'

@itdependsnetworks
Copy link
Contributor

Thanks, I am good with this! Will just make sure other maintainers are as well.

@jeffkala jeffkala changed the base branch from develop to main April 13, 2023 20:27
@jeffkala jeffkala changed the base branch from main to develop April 13, 2023 20:27
@abates
Copy link
Collaborator

abates commented Apr 13, 2023

@johanek Please resolve merge conflicts and we can approve.

Thanks!

@johanek
Copy link
Contributor Author

johanek commented Apr 15, 2023

@johanek Please resolve merge conflicts and we can approve.

Thanks!

Done!

@qduk qduk merged commit a10c288 into networktocode:develop Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants