Class: RouterCrypt::NXOS
- Inherits:
-
Object
- Object
- RouterCrypt::NXOS
- Defined in:
- lib/nxos/decrypt.rb,
lib/nxos/common.rb
Constant Summary collapse
- KEY =
'dwefsavfsdkfqweqyrmfvsfwthdwefsavfsdkfqweqyrmfvsfwthdwefsavfsdk'.unpack('C*')
- ALPHA =
('a'..'z').to_a
Class Method Summary collapse
-
.decrypt(e_pw) ⇒ String
Decrypts NXOS type 7 passwords, original research.
Class Method Details
.decrypt(e_pw) ⇒ String
Decrypts NXOS type 7 passwords, original research
7 8 9 10 11 12 13 |
# File 'lib/nxos/decrypt.rb', line 7 def decrypt e_pw index = -1 e_pw.each_char.inject("") do |d_pw, chr| index += 1 d_pw + (ALPHA.include?(chr) ? ALPHA[chr.ord - KEY[index]] : chr) end end |