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 6550847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:15:56+00:00 2026-05-25T12:15:56+00:00

I made an encrypt/decrypt methods that base on this model // encrypt: base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key),

  • 0

I made an encrypt/decrypt methods that base on this model

// encrypt:
base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key),
$string, MCRYPT_MODE_CBC, md5(md5($key))))

//decrypt:
rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key),
base64_decode($encrypted), MCRYPT_MODE_CBC, md5(md5($key))), "\0");

it all works well inside the same page, so that

decrypt(encrypt ('hello',$key))

works well,
but when I send the link:

echo "http://link.here?data=".urlencode(encrypt(('hello',$key)));

on the other receiving page I:

decrypt(urldecode($_GET['data']),$key));

I get a mess.

I notice that there is something VERY weird happening to the decrypted message.

I encrpyt ’72’, then read it back and decrypt it.
I noticed something very weird was happening when I tested it with is_numeric()… It didn’t respond to either true nor false !! something weird was going on….
So I tested with strlen, and the result was… 4 !
I figured something somehow happened with the bytes, but I have NO idea what it may be.
I am trying to pass a number through an email body, and I am trying to make it work,
any help would be appreciated.

  • 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-25T12:15:56+00:00Added an answer on May 25, 2026 at 12:15 pm

    Try taking the urldecode out of the code on your receiving page.

    Unless you’ve got double-encoding going on somewhere (and there’s no sign of that in what you’ve posted), you don’t need (or want) to urldecode strings from $_GET. PHP does this for you.

    For “text-only” data, urldecoding too many times can end up being harmless. However, in your specific case, where the underlying text is Base64, it’s very likely to be harmful, since urldecode converts + signs (which are one of the characters used in Base64) to spaces.

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

Sidebar

Related Questions

I am using this function I made to encrypt data: function encryptCredential($data) { $key
I am implementing a method to encrypt with a key and i made a
I'm trying to connect to a website I made with auth that uses MD5.hex(password)
I need help converting this into PHP: Public Function Encrypt(ByVal text As String) As
Does anyone know why this php encrypt/decrypt is not working? We used this in
Made this nice little loop for hiding and showing div's, works as a charm
I made a class that derives from Component: public class MyComponent: System.ComponentModel.Component { }
I made a code that translate strings to match each word from the array
I made a UIView using Interface Builder with a top bar that has Cancel
I'm trying to encrypt and decrypt data using RSA in C#. I have the

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.