MonkeyBusiness/utils/arc4.py

17 lines
483 B
Python
Raw Normal View History

2022-08-26 12:39:11 +02:00
from Cryptodome.Cipher import ARC4
from Cryptodome.Hash import MD5
class EamuseARC4:
def __init__(self, eamuseKey):
2022-11-15 15:03:37 +01:00
self.internal_key = bytearray.fromhex(
"69D74627D985EE2187161570D08D93B12455035B6DF0D8205DF5"
)
2022-08-26 12:39:11 +02:00
self.key = MD5.new(eamuseKey + self.internal_key).digest()
def decrypt(self, data):
return ARC4.new(self.key).decrypt(bytes(data))
def encrypt(self, data):
return ARC4.new(self.key).encrypt(bytes(data))