A Ruby-based implementation of a Cisco Type-7 Password Encryptor/Decryptor
- Written in Ruby - First and only Cisco Type-7 implementation in Ruby that I know of.
- Minimal/No Dependancies - Uses native Ruby to do it's work, no heavy dependancies.
- Not Just a Script - Implementation is portable for use in another project or for automation of tasks.
- Simple - It is a small project so the interfaces are simple and easy to use.
- Encrypt & Decrypt - Supports both encryption (with seed control) and decryption operations.
To install, type
gem install c7decrypt
c7decrypt -h to get this
Usage: c7decrypt [option] [hash/file] -s, --string [HASH] A single encrypted hash string -f, --file [FILE] A file containing multiple hashes -h, --help Show this message Example: c7decrypt -s 04480E051A33490E Example: c7decrypt -f config.txt
To use, just require
Decrypt A Single Encrypted Password
>> C7Decrypt.decrypt("060506324F41") => "cisco"
Decrypt Array of Encrypted Passwords
>> encrypted_hashes = ["060506324F41", "0822455D0A16"] => ["060506324F41", "0822455D0A16"] >> C7Decrypt.decrypt_array(encrypted_hashes) => ["cisco", "cisco"]
Decrypt Encrypted Passwords from Config
>> C7Decrypt.decrypt_config("cisco_config.txt") => ["cisco", "Password1", "admin"]
Encrypt A Single Plaintext Password
>> C7Decrypt.encrypt("cisco") => "02050D480809"
Encrypt A Single Plaintext Password w/ Explicit Seed
>> C7Decrypt.encrypt("cisco", 6) => "060506324F41"
Encrypt An Array of Plaintext Passwords
>> passwords = ["cisco", "password"] => ["cisco", "password"] >> C7Decrypt.encrypt_array(passwords) => ["02050D480809", "021605481811003348"]
This project is integrated with travis-ci and is regularly tested to work with the following rubies:
- 1.9.1 - Tested outside of Travis-CI
- 1.8.6 - Tested outside of Travis-CI
To checkout the current build status for these rubies, click here.
If you are interested in contributing to this project, please see CONTRIBUTING.md
Sources of Inspiration for C7Decrypt
- Daren Matthew - For his blog post on the subject aggregating tools and sources that perform the decryption/decoding logic.
- m00nie - For the blog post on the subject, the source code of type7tool.pl and it's encryption techniques.
Application(s) that use C7Decrypt
- Marcus J Carey - For his web application implementation of this on the ThreatAgent website. Check it out and start decrypting Cisco type-7 passwords right now.