Why is mcrypt_encrypt() putting binary characters at the end of my string?

前端 未结 4 1950
有刺的猬
有刺的猬 2020-12-06 18:33

Here is a PHP demo script that encrypts and decrypts data:



        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 18:53

    I think the problem is that you are using binary data when:

    mcrypt_encrypt — Encrypts plaintext with given parameters

    You can use base64_encode($text) for use plaintext.

提交回复
热议问题