简体   繁体   中英

Can you encrypt a string in Swift that is exactly like PHP's mcrypt_rijndael_256?

Need to communicate with PHP code that decrypts in MCRYPT_RIJNDAEL_256 . Is there any way I can use something exactly like MCRYPT_RIJNDAEL_256 in Swift?

Update: It's worth adding that I have been using AES256, because I was under the impression that AES256 and MCRYPT_RIJNDAEL_256 were the same thing (I understand now that this is not the case)

No you cannot, not without using 3rd party libraries. Rijndael 256 is a block cipher with 256 bit block size. Last time I checked the API doesn't contain Rijndael 256 or any other block cipher with that block size, and you cannot force any AES functionality to use a larger block size.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM