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

  • Home
  • SEARCH
  • 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 9194163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:20:30+00:00 2026-06-17T21:20:30+00:00

I am using this code to decrypt the information sent by GET on the

  • 0

I am using this code to decrypt the information sent by GET on the other hand:

$key              ="key";
$ema              =$_GET['email'];
$iv               =$_GET['iv'];
$ema              =substr($ema,1,-1);
$iv               =substr($iv,1,-1);
$ema              =rawurldecode($ema);
$cipher_alg       = MCRYPT_RIJNDAEL_128;
$decrypted_string = mcrypt_decrypt($cipher_alg, $key, $ema, MCRYPT_MODE_CBC, $iv);

echo $decrypted_string;

For example, this outputs hello@xyz.com. However when i compare this string with if statement:

if($decrypted_string=="hello@xyz.com")
echo "Match";
else
echo "No match";

This outputs a strange answer No match. I am unable to get why is it happening.
This is the result of var_dump($decrypted_string):

string(32) "priyam@itbhu.ac.in" 
  • 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-06-17T21:20:32+00:00Added an answer on June 17, 2026 at 9:20 pm

    Note that mcrypt_decrypt will be padded to blocksize of the mode, as stated on http://php.net/manual/en/function.mcrypt-decrypt.php

    The data that will be decrypted with the given cipher and mode. If the
    size of the data is not n * blocksize, the data will be padded with
    ‘\0’.

    One solution is to trim the data after decrypting if you can guarantee that the original data should never end with trailing whilespaces, if not you could dedicate the first few bytes to the length of the original data and use that after decryption. Note that as the blocksize you chose is 128 bit, the data will be a multiple of 32 bytes (8 bits to a byte).

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

Sidebar

Related Questions

I´m using this code to Encrypt and Decrypt in Java and Android some Strings
I'm using this code snippet to encrypt/decrypt data in my app's database: http://www.androidsnippets.com/encryptdecrypt-strings It
I am using this code to encryp/decrypt strings between c# and php: class encryption
I'm trying to encrypt and decrypt files with C++, using this code: #include <iostream>
I'm trying to decrypt an encrypted image in Android using this code: public class
I am using this code: http://examples.javacodegeeks.com/core-java/crypto/encrypt-decrypt-file-stream-with-des for encrypting my zip files used in android
Using this code, i am able to send a notification to my own device.
Using this code to zip a folder and it works perfect on small files
Using this code var html='<div class=somediv></div>'; var target=document.getElementById('contentArea'); target.appendChild(html); I'm getting Uncaught Error: NOT_FOUND_ERR:
Using This code: I am tring to fill the page with the data and

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.