How can I encrypt with AES in C# so I can decrypt it in PHP?

后端 未结 4 1836
小蘑菇
小蘑菇 2020-12-12 06:25

I\'ve found a few answers to Encrypt in PHP, and Decrypt in C#, but as yet have been unable to reverse the process...

The background is I want to:

In C#: AES

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 06:58

    I know this was asked a while ago but I thought I'd post my solution for others. I wrote up a quick code example in PHP and C# that lets you encrypt/decrypt both ways. I had a few issues with getting the settings on both sides to work out. A difference in padding would let it decrypt one way but not the other

    https://github.com/dchymko/.NET--PHP-encryption

    hope that helps some people.

提交回复
热议问题