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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:57:47+00:00 2026-05-23T19:57:47+00:00

I use following class to encrypt/decrypt my texts. http://code.google.com/p/iphonebits/source/browse/trunk/src/Encryption/NSData-AES.m?r=2 This works perfectly. But when

  • 0

I use following class to encrypt/decrypt my texts.

http://code.google.com/p/iphonebits/source/browse/trunk/src/Encryption/NSData-AES.m?r=2

This works perfectly. But when I decrypt the encrypted text with an invalid key (any one other than encryption key) this returns some text and its not in the actual length of the decrypted text. What can be the reason (is this supposed to return nil)? Is this the better way? Does libraries supposed to return errors for invalid decryption keys? Is it a must or not?

Thank you

  • 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-23T19:57:48+00:00Added an answer on May 23, 2026 at 7:57 pm

    Well, the algorithm will not know if the key that you are providing is the right one. To know if the key is right the algorithm would have to have it’s copy, which is unsafe. Although it could have the copy of it’s hash, but that would still apply that the encryption and decryption algorithms would work for only one key. Your current decryption accepts the key and put’s it to work in the decoding algorithm. The result should reflect the original text but if the key was wrong it will give you the text generated according to the wrong key. It’s all working properly.

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

Sidebar

Related Questions

I use the following class to encrypt and decrypt a string. After creating two
I have following code snippet that i use to compile class at the run
I will use (again) the following class hierarchy: Event and all the following classes
In Ruby 1.9, I can use its class variable like the following: class Sample
I use the following function to show controls on my form: class procedure TFormMain.FadeControls(ctrl:Array
I have the following use case: There's a class called Template and with that
Consider the following use of template template parameters... #include <iostream> template <typename X> class
I use the following: public interface IRepository<T> { void Add(T entity); } public class
Please consider the following simple use case: public class Foo { public virtual int
I'm working with java, trying to use the AudioFormat Class. I have the following

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.