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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:43:11+00:00 2026-05-25T02:43:11+00:00

I plan on using the AWS SDK for iOS for an upcoming project. I

  • 0

I plan on using the AWS SDK for iOS for an upcoming project. I need to store credentials for AWS with the packed application. Where is the most secure place to place them? I know that storing them in a pList would be a bad idea. Is it better to just ‘hard-code’ it into a class that will be compiled? Is there any risk there?

  • 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-25T02:43:12+00:00Added an answer on May 25, 2026 at 2:43 am

    I believe that completely hiding the credentials is theoretically impossible. That is, if your compiled code can read them, then in theory so can anyone with access to the compiled code. But imperfect security is still worth something. I’d guess that most attackers would just look through the binary for strings that look like secret keys, and not go to the trouble of decompiling the code and trying to interpret how it works, so one way to hide the credentials would be to store them in an encoded form, then decode them as needed. This way the decoding algorithm becomes your key, and an attacker would have to find and understand it to extract your credentials.

    Here’s a fairly simple way to do it using a random XOR mask. Replace the following bogus password with yours, and remember to keep the NULL terminator (\0) in place. Compile and run this code as a standalone program:

    #include <stdio.h>
    
    #define PAD_LENGTH 32
    
    int main() {
      int i;
      char c;
    
      // start with the password
      char password[PAD_LENGTH] = "My AWS Password\0";
    
      // make a random pad to encrypt it
      printf("PAD:\n{");
      char pad[PAD_LENGTH];
      for (i = 0; i < PAD_LENGTH; i++) {
        c = arc4random() & 0xFF;
        pad[i] = c;
        printf("%#02x", c & 0xFF);
        if (i < PAD_LENGTH - 1) printf(",");
      }
      printf("}\n");
    
      // make an encrypted version of the password
      printf("KEY:\n{");
      for (i = 0; i < PAD_LENGTH; i++) {
        c = pad[i] ^ password[i];
        printf("%#02x", c & 0xFF);
        if (i < PAD_LENGTH - 1) printf(",");
      }
      printf("}\n");
    
      return(0);
    }
    

    Then copy the generated pad and key into code like this (which will actually get included with your app):

    #define PAD_LENGTH 32
    
    char pad[PAD_LENGTH] = {0x83,0x26,0x8a,0x8b,0xee,0xab,0x6,0xed,0x2e,0x99,0xff,0x23,0x7f,0xef,0xc8,0x8,0x6b,0x8e,0xa4,0x64,0x6d,0xb,0x7,0xd2,0x6a,0x39,0x60,0xa4,0xa9,0xad,0xea,0xb8};
    char key[PAD_LENGTH] = {0xce,0x5f,0xaa,0xca,0xb9,0xf8,0x26,0xbd,0x4f,0xea,0x8c,0x54,0x10,0x9d,0xac,0x8,0x6b,0x8e,0xa4,0x64,0x6d,0xb,0x7,0xd2,0x6a,0x39,0x60,0xa4,0xa9,0xad,0xea,0xb8};
    for (int i = 0; i < PAD_LENGTH; i++) {
      key[i] = key[i] ^ pad[i];
    }
    NSString *password = [NSString stringWithCString:key encoding:NSASCIIStringEncoding];
    

    Since this is on a public forum, you might want to change a few things, like making the pads a different length, splitting them up and rejoining them with code, reordering them, etc. You could also store the pad and key in distant parts of the code. A truly skilled and dedicated attacker is going to be able to find your password no matter what, but the basic idea is that most people scanning the binary for a password will not find it as such.

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

Sidebar

Related Questions

I'm new to ASP.NET MVC, and plan on using it for an upcoming project.
I'm using Perl/Tk to build the GUI for an application. I plan on adding
I am using mod_perl for my web application. Currently, I plan to use a
I am confused when using resource files. In my application I need to save
I'm starting a new project and plan on using nhibernate. I'm struggling with whether
I plan on using JSONP to call an external web service to get around
Do you plan on using Factor ? Have you looked at it? Checked it
I plan to build a database management system using Grails as the main framework.
I plan to configure weblogic's gzip servlet filter (using weblogicx-gzip.jar) to gzip my web
As I plan to switch my career to a 100% web services development company(using

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.