Class: CoBreak::Box::Cipher
- Inherits:
-
Object
- Object
- CoBreak::Box::Cipher
- Defined in:
- lib/cobreak/cobreak.rb
Overview
encoding and decoding algoritmhs
Class Method Summary collapse
Class Method Details
.coding ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cobreak/cobreak.rb', line 21 def self.coding() = .enc = "" if .enc.nil? == true .dec = "" if .dec.nil? == true .cipher = %w[Base16 Base32 Base64 Ascii85 Binary Cesar] if (.cipher.include?(.enc.capitalize)) or (.cipher.include?(.dec.capitalize)); if (File.exists?(.algo)); IO.foreach(.algo){|line| line.chomp! if (.cipher?(.enc.capitalize)) CoBreak::Cifrado.cipher(line.to_s) end if (.cipher.include?(.dec.capitalize)) CoBreak::Decifrado.cipher(line.to_s) end } else if (.cipher.include?(.enc.capitalize)) CoBreak::Cifrado::cipher(.enc, .algo.to_s) end if (.cipher.include?(.dec.capitalize)) CoBreak::Decifrado::cipher(.dec,.algo.to_s) end end end end |