This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes PHP and the fly likes How to decrypt C# code in php Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "How to decrypt C# code in php" Watch "How to decrypt C# code in php" New topic

How to decrypt C# code in php

Dinesh Pise

Joined: Jul 18, 2012
Posts: 27
Hi friends,

I have written code C# for encryption using Rijndael algorithm.Now i want to decrypt it in php. I tried for that but not getting exact string which i encrypted.
Below is the encryption code for C#.

Decryption code in php is

Using above php code ,I am not getting original value. Kindly advice.....

Dinesh Pise
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 70

I would first verify that a specific plain text string gets encrypted to the exact same encrypted and encoded string in both environments. If not, then the algorithms are not compatible (perhaps due to differences in interpretation of the algorithm, or perhaps in one group 'tweaking' the algorithm to 'make it better'). If the encoded strings are not the same, you will have to try other algorithms until you find one that generates the same encoded string on both platforms.
I agree. Here's the link:
subject: How to decrypt C# code in php
Similar Threads
BadPaddingException using AES
AES Encryption Service
javax.crypto.BadPaddingException: Given final block not properly padded
PBE decryption does not work
Java Decryptor for .NET AES Encryptor