Class: Cipher::ChaoCipher
- Inherits:
-
Substitution
- Object
- SimpleCipher
- Substitution
- Cipher::ChaoCipher
- Includes:
- Crypto
- Defined in:
- lib/cipher.rb
Overview
ChaoCipher
Cipher invented in 1917 but only recently released. See www.mountainvistasoft.com/chaocipher/index.htm Key schedule in lib/key.rb
Constant Summary
Constant Summary
Constants included from Crypto
Instance Attribute Summary (collapse)
-
- (Object) key
readonly
Returns the value of attribute key.
Instance Method Summary (collapse)
-
- (ChaoCipher) initialize(pw, cw, flag = false)
constructor
initialize.
Methods included from Crypto
#addmod10, #chainadd, #expand5to10, #find_hole, #keyshuffle, #normalize, #p1_encode, #str_to_numeric, #submod10
Methods inherited from Substitution
Methods inherited from SimpleCipher
Constructor Details
- (ChaoCipher) initialize(pw, cw, flag = false)
initialize
366 367 368 369 370 371 372 |
# File 'lib/cipher.rb', line 366 def initialize(pw, cw, flag = false) if flag then pw = keyshuffle(pw, Key::ChaoKey::BASE) cw = keyshuffle(cw, Key::ChaoKey::BASE) end @key = Key::ChaoKey.new(pw, cw) end |
Instance Attribute Details
- (Object) key (readonly)
Returns the value of attribute key
362 363 364 |
# File 'lib/cipher.rb', line 362 def key @key end |