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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:37:32+00:00 2026-06-04T08:37:32+00:00

When I try to decrypt a cipher text using the wrong key, CCCrypt returns

  • 0

When I try to decrypt a cipher text using the wrong key, CCCrypt returns kCCDecodeError.

Question is, does it do so reliably (eg. am I guaranteed that if it returns success, my input key was the key used to encrypt the plain text, and am I also guaranteed that my output data is my original plain text) and how can it even know whether my key is correct or not?

As far as I understood crypto, the engine cannot predict whether the key is valid and should just give me random noise as output data and a successful return code.

  • 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-04T08:37:33+00:00Added an answer on June 4, 2026 at 8:37 am

    If you specified PCKS7 padding (kCCOptionPKCS7Padding) then it can tell if you failed to decrypt it properly – most of the time. There is a chance that the random result of the wrong key could cause the last bits of the message to look like valid PKCS7 padding.

    The only other thing it can detect is if your key is not a valid length at all.

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

Sidebar

Related Questions

I try to decrypt data that was originally encrypted with Objective-C in Java. There
I'm trying to encrypt a text file using Perl and then decrypt it using
I'm using javax.crypto.Cipher to encrypt a file and then decrypt it but I'm still
try: spam.foo except AttributeError: do_somthing() (Is it wise to check an attribute like that
I am trying to write encrypt/decrypt methods for AES 256 CBC encryption using PKCS5Padding
I am trying to decrypt in JAVA a string that was encrypted in C#.
I'm implementing encryption / decryption using Java Cipher and AES. Everything is working well
I have some code that is working correctly in Java but when I try
I am using a AES cipher with a 16 byte block size. If I
I have a file that was encrypted using AES. I use the following NSData

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.