AES-256 encryption in PHP

前端 未结 4 2057
暖寄归人
暖寄归人 2020-12-02 21:18

I need a PHP function, AES256_encode($dataToEcrypt) to encrypt the $data into AES-256 and another one AES256_decode($encryptedData) do

4条回答
  •  情深已故
    2020-12-02 21:37

    MCRYPT_RIJNDAEL_256 is not equivalent to AES_256.

    The way to make RIJNDAEL be decrypted from AES is to use MCRYPT_RIJNDAEL_128 and padd the string to encrypt before encrypting

    AES-256 has BlockSize=128bit and KeySize=256bit Rijndael-256 has BlockSize=256bit and KeySize=256bit

    Just AES/Rijndael 128bit are identical. Rijndael-192 and Rijndael-256 are not identical to AES-192 and AES-256 (block sizes and number of rounds differ).

提交回复
热议问题