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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:22:28+00:00 2026-05-17T02:22:28+00:00

I am developing logon function for my iPhone Application, so I want to hash

  • 0

I am developing logon function for my iPhone Application, so I want to hash the password using the SHA512 hashing algorithm then get the result as NSString (the result should be the same with SHA512 in C#). After spending a lot of time in the internet, I still not find out the solution yet! 🙁

Is there anyone has the solution and sample code, please help me!
Thanks a lot!

[Update]
In my C# code, the password is stored using SecureString, so maybe it’s cause make different byte array between objective-c and C#

  • 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-17T02:22:29+00:00Added an answer on May 17, 2026 at 2:22 am

    This function will hash a string using SHA512. The resulting string is a hex representation of the hash:

    + (NSString *) createSHA512:(NSString *)source {
    
        const char *s = [source cStringUsingEncoding:NSASCIIStringEncoding];
    
        NSData *keyData = [NSData dataWithBytes:s length:strlen(s)];
    
        uint8_t digest[CC_SHA512_DIGEST_LENGTH] = {0};
    
        CC_SHA512(keyData.bytes, keyData.length, digest);
    
        NSData *out = [NSData dataWithBytes:digest length:CC_SHA512_DIGEST_LENGTH];
    
        return [out description];
    }
    

    Don’t forget to include the correct header:

    #include <CommonCrypto/CommonDigest.h>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web application using .net/c#/jQuery. I want to develop an AJAX function
I am new in developing android applications. I want to create an android application(using
I'm developing an iPhone application where I wish to authenticate (login form) on a
I'm developing an web application in Java and using facebook account for login to
I'm developing a web application using .net/c#. I have a user control that I
I'm developing a Windows 8 application using HTML5. The application requires some user data
This is a urgent question to be answered quickly. I'm developing iPhone application to
I am developing a login form with User Name and Password. I want the
Currently, I'm developing an application using standard PHP. As such, there are assorted functions
I am trying to get value from passwordbox for developing a simple login functionality,

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.