Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6007769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:43:46+00:00 2026-05-23T01:43:46+00:00

Fixed it. $data = base64_decode(str_replace(‘ ‘, ‘+’, $_GET[‘data’])); for whatever reason, Php was converting

  • 0

Fixed it.

$data = base64_decode(str_replace(' ', '+', $_GET['data']));

for whatever reason, Php was converting the +’s from the GET variablesinto spaces

—

I am trying to decrypt a string that is being decrypted in C#.NET.

The results of the code vary, There were several occasions where the final string had some parts decrypted, and the rest of it was random characters.

Most of the time the “decrypted” string is just all random characters, I also tried some Php functions to remove PKCS7 padding but none of them fixed the problem.

I’ve looked at several similar questions on the site but none of them were of help.

C#

// called as Response.Redirect(url + encryptParams(param));

private string encryptData(string data)
{
    Rijndael aes = Rijndael.Create();
    aes.KeySize = 256;
    aes.BlockSize = 256;
    aes.Mode = CipherMode.CBC;
    aes.Padding = PaddingMode.PKCS7;
    aes.Key = Convert.FromBase64String("b0dJN2c6cklVUX1qUGlFfGMweXRKbH5fSEMuXjAgfQo=");

    ICryptoTransform crypto = aes.CreateEncryptor(aes.Key, aes.IV);
    byte[] txt = ASCIIEncoding.UTF8.GetBytes(data);          
    byte[] cipherText = crypto.TransformFinalBlock(txt, 0, txt.Length);

    return "&data=" + Convert.ToBase64String(cipherText) + "&iv=" + Convert.ToBase64String(aes.IV);
}

Php:

   $data = base64_decode($_GET['data']);
   $iv = base64_decode($_GET['iv']);

   echo "<br /><b>IV</b>: " . $_GET['iv'] .
       "<br /><b>Encrypted String</b>: <br /><textarea>".$_GET['data']."</textarea>" .
       "<br /><b>key size:</b> " . mcrypt_get_key_size ( MCRYPT_RIJNDAEL_256,  MCRYPT_MODE_CBC) .
       "<br /><b>block size:</b> " . mcrypt_get_block_size ( MCRYPT_RIJNDAEL_256,  MCRYPT_MODE_CBC) .
       "<br /><b>cipher:</b> " . mcrypt_get_cipher_name ( MCRYPT_RIJNDAEL_256 ) .
       "<br /><b>iv size:</b> " .  mcrypt_get_iv_size  ( MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC) . "<br />"; 

   echo "Result: " . 
      mcrypt_decrypt
      (
          MCRYPT_RIJNDAEL_256,
          base64_decode("b0dJN2c6cklVUX1qUGlFfGMweXRKbH5fSEMuXjAgfQo="),
          $data,
          MCRYPT_MODE_CBC,
          $iv
       );

Php output:

IV: WzsMlG39tfCGuX2EQM3vq8CoqGA xC0nW jICls8Cno=
key: b0dJN2c6cklVUX1qUGlFfGMweXRKbH5fSEMuXjAgfQo=

Encrypted String: oLxa21fxfQGg0EJ5rwMjEzMblvcaTq0AInDAsD88wAkNeLqOdon0ukLjz49Hpp36KPTKcTGkj1f7EPYPAAbuADnr3Ff0zpptZkx2d22VRbHrMgj QLF9vDxQRT3er3UAXsAfKKTyW8qeSIgrzACFLX3yoro/bzWic rt7ED7y0jZ7a1Hci3GMz/4KhwaftarbV QQWStJlSOqdxAdmtRRe84Vi3085S6um51bNrh5QzGRH PcpucfqaTb3junfO9g67j2JUQaM/Tj1EGnv6oX3wATR/LuWyhnhrCH86u10I=

key size: 32
block size: 32
cipher: Rijndael-256
iv size: 32
Result:
/ci�����^/�c�g�������s��c�(��

Original String (JSON):
{“user”:”jsmith”,”firstName”:”John”,”lastName”:”Smith”,”phone”:”12223334444.5555″,”email”:”john.smith@domain.com”,”address”:”123 Some Street”,”address2″:”apt 456″,”city”:”Some City”,”state”:”LA”,”zip”:”55555″}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:43:47+00:00Added an answer on May 23, 2026 at 1:43 am

    Fixed it by using the following code.

    $data = base64_decode(str_replace(' ', '+', $_GET['data']));
    

    For whatever reason, PHP was converting the +’s from the GET variablesinto spaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m trying to import fixed width data from text file into SQL Server Express
I have a fixed-length data file need to persistence into database. I use a
For an embedded system I need to place a few data structures at fixed
I need your help with the following scenario: I am reading some data from
How to, Sequentially distribute data from a list to arrays (or some other structure)
I'm using a WebClient to get infos asynchronously from my web service : wc.DownloadStringCompleted
Fixed: See notes at bottom I am implementing a generic class that supports two
By fixed vector I mean a static list of values, like 1 through 24.
So I just fixed a bug in a framework I'm developing. The pseudo-pseudocode looks
I want to create fixed status bar in by web form to display various

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.