Class: ShadowsocksRuby::Cipher::Table
- Inherits:
-
Object
- Object
- ShadowsocksRuby::Cipher::Table
- Defined in:
- lib/shadowsocks_ruby/cipher/table.rb
Overview
Implementation of the Table cipher method.
Note: this cipher method have neither IV or key, so may be incompatible with protocols which needs IV or key.
Normally you should use #build to get an instance of this class.
Instance Method Summary collapse
-
#decrypt(message) ⇒ String
Decrypt message by provided IV.
-
#encrypt(message) ⇒ String
Encrypt message by provided IV.
- #initialize(password) ⇒ Object constructor
-
#iv_len ⇒ Integer
Get the cipher object’s IV length returns 0 for Table.
-
#key ⇒ String
Return the key, which length is decided by the cipher method.
Constructor Details
#initialize(password) ⇒ Object
15 16 17 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 15 def initialize password @encrypt_table, @decrypt_table = get_table(password) end |
Instance Method Details
#decrypt(message) ⇒ String
Decrypt message by provided IV
25 26 27 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 25 def decrypt() translate @decrypt_table, end |
#encrypt(message) ⇒ String
Encrypt message by provided IV
20 21 22 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 20 def encrypt() translate @encrypt_table, end |
#iv_len ⇒ Integer
Get the cipher object’s IV length returns 0 for Table
32 33 34 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 32 def iv_len 0 end |
#key ⇒ String
Return the key, which length is decided by the cipher method. returns nil for Table
39 40 41 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 39 def key nil end |