MCPcopy
hub / github.com/shadowsocks/shadowsocks / decrypt

Method decrypt

shadowsocks/encrypt.py:121–133  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

119 return self.cipher_iv + self.cipher.update(buf)
120
121 def decrypt(self, buf):
122 if len(buf) == 0:
123 return buf
124 if self.decipher is None:
125 decipher_iv_len = self._method_info[1]
126 decipher_iv = buf[:decipher_iv_len]
127 self.decipher_iv = decipher_iv
128 self.decipher = self.get_cipher(self.password, self.method, 0,
129 iv=decipher_iv)
130 buf = buf[decipher_iv_len:]
131 if len(buf) == 0:
132 return buf
133 return self.decipher.update(buf)
134
135
136def gen_key_iv(password, method):

Callers 3

test_encryptorFunction · 0.95
_on_local_readMethod · 0.80
_on_remote_readMethod · 0.80

Calls 2

get_cipherMethod · 0.95
updateMethod · 0.45

Tested by 1

test_encryptorFunction · 0.76