MCPcopy
hub / github.com/wechatpy/wechatpy / _encrypt

Method _encrypt

wechatpy/crypto/base.py:60–65  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

58 self.cipher = AesEcbCipher(key)
59
60 def _encrypt(self, text):
61 text = to_binary(text)
62 text = PKCS7Encoder.encode(text)
63
64 ciphertext = to_binary(self.cipher.encrypt(text))
65 return base64.b64encode(ciphertext)
66
67 def _decrypt(self, text, exception=None):
68 text = to_binary(text)

Callers

nothing calls this directly

Calls 3

to_binaryFunction · 0.90
encodeMethod · 0.80
encryptMethod · 0.45

Tested by

no test coverage detected