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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:38:50+00:00 2026-05-27T14:38:50+00:00

Recently I have been developing an app that needs AES encryption. I am using

  • 0

Recently I have been developing an app that needs AES encryption.
I am using a AES encryption library that has a call like this:

  • (NSData*)encryptData:(NSData*)data key:(NSData*)key iv:(NSData*)iv;

I understand what the data and key are for but the iv or initialization vector is confusing me.
Would somebody mind explaining to me the importance of this / what it is and what a proper initialization vector for AES would look like?

Also I would appreciate it if someone could point me in the right direction for learning basic programatic cryptography, any good books or tutorials out there for learning encryption using C libraries or Cocoa frameworks.

  • 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-27T14:38:51+00:00Added an answer on May 27, 2026 at 2:38 pm

    The iv “should” be a random string of data, you could pull data /dev/random for simplicity. It basically is the random salt that shakes up the encryption. http://en.wikipedia.org/wiki/Initialization_vector has more information on specifically what is an IV. Keep track of your iv with your key because it is used in decryption as well.

     NSString *key = @"password";
     NSString *iv = @"randomstringofcharactersfromdevrandom"
    
     NSData *cipherstream = [ EncryptionLibrary encryptData: data key: key iv: iv ];
    
     NSData *cleartext = [ EncryptionLibrary decryptData: cipherstream key: key iv: iv ];
    

    Your initialization vector should be random per application instantiation but your key is typically persistent or obtained from an SSL Certificate.

    I recommend taking a look at the a Security Transforms Programming Guide which uses SSL certificates for encryption and decryption, the initialization vectors are in the background because typically they are low level and should be viewed from an abstracted high level of managing keys not IVs.

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

Sidebar

Related Questions

We have a system built using WPF and have (until recently) been developing using
I've recently been developing a website using asp.net webforms that uses in proc sessions
I recently launched a website I have been developing over the past year -
I've been developing an app specifically for modern browsers and have made very heavy
I have been developing in ASP.NET MVC for a short while. Up to this
I've recently been developing on the django platform and have stumbled upon Django Forms
I have been developing web applications for some time but have very recently been
Recently, I was going through an open-source project and although I have been developing
I've just recently started developing a site for iPhone using jQTouch, and have the
I have an ASP.NET MVC application that I'm working on. I've been developing it

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.