first_param="{rid:\"\",offset:\"0\",total:\"true\",limit:\"20\",csrf_token:\"\"}"defget_params():iv="0102030405060708"first_key=forth_paramsecond_key=16*'F'h_encText=AES_encrypt(first_param,first_key,iv)h_encText=AES_encrypt(h_encText,second_key,iv)returnh_encTextdefAES_encrypt(text,key,iv):pad=16-len(text)%16text=text+pad*chr(pad)encryptor=AES.new(key,AES.MODE_CBC,iv)encrypt_text=encryptor.encrypt(text)encrypt_text=base64.b64encode(encrypt_text)returnencrypt_text这段代码第十一行用python就会抛出can'tconcatstrtobytes无法拼接str,试过转换bytes和转换str再合并都不行。。请教下有没有什么解决办法
人到中年有点甜
相关分类