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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:55:12+00:00 2026-05-24T19:55:12+00:00

Possible Duplicate: Why does this AES encryption on an iPad and decryption in PHP

  • 0

Possible Duplicate:
Why does this AES encryption on an iPad and decryption in PHP fail?

I use objective c to encrypt data and php to decrypt

this my code in objective c

NSString *log=[@"enfin on a terminé le projet de cette anné" AES256EncryptWithKey:key]; 
NSString *decr=[@"k6MDFVLV3UrxD63xc1gZBQ==" AES256DecryptWithKey:key]; 

and this my function in php

$key = "1234567891234567";

$st = urldecode(trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key, $tmp_st, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_RAND))));
echo("<br>");
// decrypted data
echo "decryptage de (admin) de objective c : ". $st ;

now all work ,but when i use big string more 18 string this code not work

  • 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-24T19:55:13+00:00Added an answer on May 24, 2026 at 7:55 pm

    Assuming this is the common AES256EncryptWithKey: that I’ve seen lots of people copy (for example here), it uses CBC, not ECB. It also unfortunately hard-codes the IV to NULL.

    Your PHP code appears to be generating a random IV, which is correct for encryption (though AES256EncryptWithKey: doesn’t do so), but incorrect for decryption.

    I’m not familiar with the syntax for mcrypt_decrypt, but you appear to be passing a 144 bit key to it (18 bytes). The data is encrypted with a 256-bit key. I don’t see what key you’re using in your ObjC. A key is not a password (AES256EncryptWithKey: unfortunately treats it like it is).

    You can see Properly encrypting with AES with CommonCrypto for more details on how to use CommonCrypto. As I note in the article “it’s a good idea to actually understand this code, not just copy it.” That’s critical for your PHP decrypt logic as well. You should make sure you carefully read the documentation on mcrypt_decrypt.

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

Sidebar

Related Questions

Possible Duplicate: Reference - What does this symbol mean in PHP? I was wondering
Possible Duplicate: Caret in objective C What does this ^ syntax mean in Objective-C?
Possible Duplicate: Reference - What does this symbol mean in PHP? Is there any
Possible Duplicate: What does the variable $this mean in PHP? I know this is
Possible Duplicate: Reference - What does this symbol mean in PHP? I've been doing
Possible Duplicate: Reference - What does this symbol mean in PHP? What does the
Possible Duplicate: Why does this trigger fail? It says invalid identifier. CREATE MATERIALIZED VIEW
Possible Duplicate: Reference - What does this symbol mean in PHP? I'm making a
Possible Duplicate: Reference - What does this symbol mean in PHP? What is the
Possible Duplicate: Reference - What does this symbol mean in PHP? The third line

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.