| Server IP : 104.21.37.246 / Your IP : 172.71.28.146 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /usr/lib64/python2.6/site-packages/M2Crypto/ |
Upload File : |
"""M2Crypto wrapper for OpenSSL RC4 API.
Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved."""
from m2 import rc4_new, rc4_free, rc4_set_key, rc4_update
class RC4:
"""Object interface to the stream cipher RC4."""
rc4_free = rc4_free
def __init__(self, key=None):
self.cipher = rc4_new()
if key:
rc4_set_key(self.cipher, key)
def __del__(self):
if getattr(self, 'cipher', None):
self.rc4_free(self.cipher)
def set_key(self, key):
rc4_set_key(self.cipher, key)
def update(self, data):
return rc4_update(self.cipher, data)
def final(self):
return ''