Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _decrypt_regcode_by_deviceid(reg_code, deviceid):
deviceid_digest = ripemd128(deviceid)
s20 = Salsa20(key=deviceid_digest, IV=b"\x00"*8, rounds=8)
encrypt_key = s20.encryptBytes(reg_code)
return encrypt_key
def _mdx_decrypt(comp_block):
key = ripemd128(comp_block[4:8] + pack(b'
def _decrypt_regcode_by_email(reg_code, email):
email_digest = ripemd128(email.decode().encode('utf-16-le'))
s20 = Salsa20(key=email_digest, IV=b"\x00"*8, rounds=8)
encrypt_key = s20.encryptBytes(reg_code)
return encrypt_key