Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


PHP refusing to AES Decrypt post data, but decrypts anything

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Web Development
View previous topic :: View next topic  
Author Message
Fafaffy
Advanced Cheater
Reputation: 65

Joined: 12 Dec 2007
Posts: 81

PostPosted: Sat Sep 29, 2012 9:18 am    Post subject: PHP refusing to AES Decrypt post data, but decrypts anything Reply with quote

So I have 2 functions on PHP, AES Encrypt and AES Decrypt.

They both work wonders if I encrypt/decrypt text by manually making a string containing the encrypted text, but if I decrypt data that I got from post data, everything fucks up. Can anyone help?

Here's my code: (I know it's inefficient and not secured, I'm not worried about that)
Code:

$post = $_POST['data'];

$decrypt = decrypt("Zt4Sc/NVfBicROlgEZOEv+lSyLxjc1aeehwikCys9wngPMbwQlNHaqHIQXOLMXnm20HcK5HOdfF4ocV6DMwOOt8s8eyUmptlCKNMmgS2AUxhr4CORprThMhsyh10bF+zJEI1bOENGukghKKuqL9Cm+HB52qPDs7c3JDpYK7K/iXitS4lJVzUsSxthO1i6WZiKqlHDHGkhBewp2ibStOkKbdg2DcGqxqDd0qmAnNqnNIURNcxyKvqPzcYkipy+k9kz/WVjv/ZUGh4lG175ZJhkHu/+Re9esx46FNkObeAcHE=");

echo $post . "\n\n\nDecrypted Data\n\n\n" . $decrypt . "\n\n\n Decrypting post data\n\n\n" . decrypt($post);


Here's my output:
Code:
IBTJn0zNEYWMhi aj5OKAWMUz52gjpij17s38Oec7nReP2I2oI90pjbna3gTXyx/EmFRMcqWYNRWliBKBnzHtOe9weSZoGjHNCv4guniJr0fDRwrxS5U4nxuJxLLuDLZiV1YBb1cwE/iqF46mKSyLHKfjqyjapHDwI/bwxMY5pKZFmoeJ5rMLZrR2rbz XoIZGHsrcXNJFGfJnjhJYG1i/Z2GeyjG0sESJLRgSysoJkniBGgAPbYMLXD/7z6ZqEmUdHmbcUgVmKVSnZQVD0DqC1SS5XL3xjVto8sP6cLuOc=

Decrypted Data

IRt2NZrVy3N67QpSxSnQyA+kn1es3MkTgBO+GTGLigc=
TQ6tJeD107o+0EHiNYl04udv2ttwjttEUmO1hxayQu4=
+6HO/dQTyrtS0eYxh+VUCQxVPcacn5a5uKk0Q7GFM5IFqHrHBAvl7ieFxEb9MEwLp5Z+Z6NyGdAukcPCIHPNjGoRhelgwdxicQ5RvjSV3tIQbnS+cRBSxiiWHxf0kj/Q

Decrypting post data


As you can see:
1. It detects the post data
2. It can decrypt the manually inputted string just fine
3. It doesn't show anything when decrypting post data.

Can anyone shed some light on what my problem is?
Back to top
View user's profile Send private message Send e-mail
Hans Henrik
Expert Cheater
Reputation: 0

Joined: 18 Feb 2007
Posts: 177

PostPosted: Sun Dec 15, 2013 10:27 pm    Post subject: Reply with quote

you're uploading wrong.

try this code
Code:
foreach($_POST as $key=>$data){
var_dump('$_POST key:',$key,'data:',$data,'decoded data:',decode($data));
}


and for testing, use the Javascript debugger console of your browser and run this code

Code:

xhr=new XMLHttpRequest();
xhr.open("POST","your_php_file.php",false);
fd=new FormData();
fd.append("test","this stuff ends up in $_POST['test'] ! ");
fd.append("foobar","this stuff ends up in $_POST['foobar'] ! ");
xhr.send(fd);
alert("xhr.responseText:"+xhr.responseText);
console.log(xhr.responseText);


also make sure you're doing
Code:
error_reporting(E_ALL);
at the start of your script
_________________
Im not around.

im almost never checking the forum anymore
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Web Development All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites