How to implement python encryption with PHP

< H2 > python encryption < / H2 >
def des_encrypt(data, Des_Key):
    if isinstance(data, dict):
        str = json.dumps(data)
    else:
        str = data
    Des_IV = bytes(Des_Key)
    k = des(Des_Key, CBC, Des_IV, pad=None, padmode=PAD_PKCS5)

    EncryptStr = k.encrypt(str)
    return base64.b64encode(EncryptStr) -sharpbase64

how to implement

with PHP? < hr >

python uses the package pyDes

Apr.09,2021

PHP has a OpenSSL function that can be written by itself, and it's nice to have a phpseclib in the third-party library.


W3school
Baidu PHP crypt can find it =


php7 take a look at openssl

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1cfa497-3a19d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1cfa497-3a19d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?