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) ⇒ Table
constructor
A new instance of Table.
-
#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) ⇒ Table
Returns a new instance of Table.
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
29 30 31 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 29 def decrypt() translate @decrypt_table, end |
#encrypt(message) ⇒ String
Encrypt message by provided IV
22 23 24 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 22 def encrypt() translate @encrypt_table, end |
#iv_len ⇒ Integer
Get the cipher object’s IV length returns 0 for Table
36 37 38 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 36 def iv_len 0 end |
#key ⇒ String
Return the key, which length is decided by the cipher method. returns nil for Table
43 44 45 |
# File 'lib/shadowsocks_ruby/cipher/table.rb', line 43 def key nil end |