lua-string-resty的aes加密解密,无法和python的aes进行对接,


https://groups.google.com/forum/#!topic/openresty/syqjf7C8O74




openssl默认的padding是PKCS7 见https://en.wikipedia.org/wiki/Padding_%28cryptography%29#PKCS7,lua-resty-string中调用的是openssl的库,所以加的padding也是和openssl一样的,https://en.wikipedia.org/wiki/Padding_%28cryptography%29#PKCS7,那么在python中,padding也要设置成PKCS7,见https://gist.github.com/chrix2/4171336

这样,加密后的输出就一样了


相关内容

    暂无相关文章