优化工单模块,增加企微模块
This commit is contained in:
15
sg_wechat_enterprise/we_api/crypto/pycrypto.py
Normal file
15
sg_wechat_enterprise/we_api/crypto/pycrypto.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from Crypto.Cipher import AES
|
||||
|
||||
|
||||
class WeChatCipher(object):
|
||||
|
||||
def __init__(self, key):
|
||||
self.cipher = AES.new(key, AES.MODE_CBC, key[:16])
|
||||
|
||||
def encrypt(self, plaintext):
|
||||
return self.cipher.encrypt(plaintext)
|
||||
|
||||
def decrypt(self, ciphertext):
|
||||
return self.cipher.decrypt(ciphertext)
|
||||
Reference in New Issue
Block a user