PHP equivalent of .net AES encryption

前端 未结 2 1708
不思量自难忘°
不思量自难忘° 2021-01-29 14:07

I am working on a data exchange integration with my client and the data they send me is encrypted using their C# encrypt method (below).

My app is running

2条回答
  •  一个人的身影
    2021-01-29 14:51

    It seems like the PHP Script is Using the wrong Mode:
    https://msdn.microsoft.com/en-us/library/system.security.cryptography.symmetricalgorithm.mode%28v=vs.110%29.aspx
    The C# Functions do not set any Mode so the default is CBC.
    The PHP part uses ECB instead, which is not only wrong, but insecure.

提交回复
热议问题