skip to Main Content

How to convert bits from python to php?

I have this hex code F0C2CA89012A04008C0000000000000000000000 from the device. This hex code shows the value of the water drops. In my python code msg = F0C2CA89012A04008C0000000000000000000000 msg_counters = bytes.fromhex(msg)[5:20] # output: b'*x04x00x8cx00x00x00x00x00x00x00x00x00x00x00' msg_counters_int = int.from_bytes(msg_counters) # output: 218157641024778742068286256301735936 bin_string =…

VIEW QUESTION

Decrypt AES-256-CBC in php

I encrypt in Python this way: from Crypto.Cipher import AES from base64 import b64decode, b64encode BLOCK_SIZE = 16 pad = lambda s: s + (BLOCK_SIZE - len(s.encode()) % BLOCK_SIZE) * chr(BLOCK_SIZE - len(s.encode()) % BLOCK_SIZE) unpad = lambda s: s[:-ord(s[len(s)…

VIEW QUESTION
Back To Top
Search