Skip to content

Conversation

@mundruid
Copy link
Contributor

Encrypt type7 is not working per issue #108. Type 7 is fixed and a PoC using python interpreter is pasted below. For additional verification of the generate password you can use: https://www.firewall.cx/cisco-technical-knowledgebase/cisco-routers/358-cisco-type7-password-crack.html

from netutils.password import encrypt_type7, decrypt_type7
strings_to_encrypt = ['cisco', 'badpassword123', 'thisisnosecre *%+', 'the \chronicles of narnia', '123456789012345678901234567890']

for s in strings_to_encrypt:
    encrypted = encrypt_type7(s)
    print(encrypted)
    print(decrypt_type7(encrypted))

"""
070C285F4D06
cisco
130716161B0D17393C2B3A37647040
badpassword123
105A0110161E010503172F28362D737F6758
thisisnosecre *%+
061207240C720A1117181C020F082F38642735752C1215180A00

14141B180F0B
cisco
104C081D151601181B0B382F757A60
badpassword123
150603051723382A2720302101025649441D
thisisnosecre *%+
13111F174B300722392B263A362E1614560C07165759415A0702
the \chronicles of narnia

070C285F4D06
cisco
130716161B0D17393C2B3A37647040
badpassword123
120D0D1E01021F0A2538212B21306259425D
thisisnosecre *%+
0958460C5939141A19030A2328282D20752D1547180213585059
"""

Addresses #108

Dr. X and others added 4 commits June 27, 2022 09:00
Co-authored-by: Jeff Kala <48843785+jeffkala@users.noreply.github.com>
Co-authored-by: Ken Celenza <ken@celenza.org>
@itdependsnetworks itdependsnetworks merged commit e757bfe into networktocode:develop Jun 30, 2022
jeffkala added a commit that referenced this pull request Aug 5, 2022
* Updated lib mapping docs (#113)

* Updated lib mapping docs

* Updated per review suggestions

* Pinned mistune for m2r2 (#114)

* Switch to poetry-core

* Update banner parsing for EOS (#121)

Update banner parsing for EOS

* Fixes encrypt type7 (#122)

* fixes encrypt type7

* Document support on duplicate lines (#128)

* Few updates to PR of 125 (#129)

* initial pass at type hinting and getting mypy to run

* update tasks and ci to do mypy as well

* rm unused import

* fix contributing end-line number

* fix contributing end-line number

* Add py.typed file to signify availability of type hints to third parties.

* Updates to type hinting.

* Add EOS _build_banner type hints.

* Address feedback.

* Linting.

* Remove .idea from commit and ignore in .gitignore.

* Remove remnants of merge conflict.

* PR feedback.

* PR comments.

* Ignore pylint errors for abstract-method.

* Black.

* add examples and better exception messaging

Co-authored-by: Leo Kirchner <leo@kirchne.red>

* Adding nxos_ssh to Napalm mapper (#138)

* Update CODEOWNERS (#134)

adding codeowner

* prep for 1.2.0 release (#143)

* prep for 1.2.0 release

* Update CHANGELOG.md

Co-authored-by: Jeff Kala <48843785+jeffkala@users.noreply.github.com>

Co-authored-by: Jeff Kala <48843785+jeffkala@users.noreply.github.com>

Co-authored-by: Adam Byczkowski <38091261+qduk@users.noreply.github.com>
Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
Co-authored-by: Ken Celenza <ken@celenza.org>
Co-authored-by: Dr. X <xenia.mountrouidou@networktocode.com>
Co-authored-by: Leo Kirchner <leo@kirchne.red>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Co-authored-by: Andrew Bates <abates@omeganetserv.com>
itdependsnetworks pushed a commit to itdependsnetworks/netutils that referenced this pull request Nov 3, 2022
itdependsnetworks added a commit to itdependsnetworks/netutils that referenced this pull request Nov 3, 2022
* Updated lib mapping docs (networktocode#113)

* Updated lib mapping docs

* Updated per review suggestions

* Pinned mistune for m2r2 (networktocode#114)

* Switch to poetry-core

* Update banner parsing for EOS (networktocode#121)

Update banner parsing for EOS

* Fixes encrypt type7 (networktocode#122)

* fixes encrypt type7

* Document support on duplicate lines (networktocode#128)

* Few updates to PR of 125 (networktocode#129)

* initial pass at type hinting and getting mypy to run

* update tasks and ci to do mypy as well

* rm unused import

* fix contributing end-line number

* fix contributing end-line number

* Add py.typed file to signify availability of type hints to third parties.

* Updates to type hinting.

* Add EOS _build_banner type hints.

* Address feedback.

* Linting.

* Remove .idea from commit and ignore in .gitignore.

* Remove remnants of merge conflict.

* PR feedback.

* PR comments.

* Ignore pylint errors for abstract-method.

* Black.

* add examples and better exception messaging

Co-authored-by: Leo Kirchner <leo@kirchne.red>

* Adding nxos_ssh to Napalm mapper (networktocode#138)

* Update CODEOWNERS (networktocode#134)

adding codeowner

* prep for 1.2.0 release (networktocode#143)

* prep for 1.2.0 release

* Update CHANGELOG.md

Co-authored-by: Jeff Kala <48843785+jeffkala@users.noreply.github.com>

Co-authored-by: Jeff Kala <48843785+jeffkala@users.noreply.github.com>

Co-authored-by: Adam Byczkowski <38091261+qduk@users.noreply.github.com>
Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
Co-authored-by: Ken Celenza <ken@celenza.org>
Co-authored-by: Dr. X <xenia.mountrouidou@networktocode.com>
Co-authored-by: Leo Kirchner <leo@kirchne.red>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Co-authored-by: Andrew Bates <abates@omeganetserv.com>
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.

encrypt_type7 function does not generate correct encrypted password

4 participants