Class: DCase::Crypto
Instance Method Summary collapse
- #decrypt(data) ⇒ Object
- #encrypt(data) ⇒ Object
-
#initialize(password) ⇒ Crypto
constructor
A new instance of Crypto.
Methods included from Table
#get_table, #merge, #merge_sort, #translate
Methods included from Ext
Constructor Details
#initialize(password) ⇒ Crypto
Returns a new instance of Crypto.
5 6 7 |
# File 'lib/dcase/crypto.rb', line 5 def initialize(password) @encrypt_table, @decrypt_table = get_table(password) end |
Instance Method Details
#decrypt(data) ⇒ Object
13 14 15 |
# File 'lib/dcase/crypto.rb', line 13 def decrypt(data) translate(@decrypt_table, data) end |
#encrypt(data) ⇒ Object
9 10 11 |
# File 'lib/dcase/crypto.rb', line 9 def encrypt(data) translate(@encrypt_table, data) end |