Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread Display Modes
Old Oct 29, 2012, 02:18 PM   #1
macrumors newbie
Join Date: Oct 2012
encrypt NSString with MD5 and specific key


i have a key that i want to us and run the key with MD5 ON A sTRING OBJECT

macdan56 is offline   0 Reply With Quote
Old Oct 29, 2012, 04:24 PM   #2
macrumors 603
Join Date: Aug 2009
MD5 is a Message Digest algorithm, not encryption. It doesn't support use of a key.

The simplest way to understand the difference between a message digest and encryption is that encryption is invertible: it allows recovery of the complete original message (the plaintext or cleartext), when decryption is performed with a suitable key. By contrast, message digest algorithms are designed to be non-invertible: the contents of the original message cannot be recovered by any computation performed on the output (the hash value).

To encrypt or hash an NSString, using a suitable algorithm and key, look at the NSString methods that return NSData objects. A returned NSData is a series of bytes in a particular text encoding. The text encoding is passed as a parameter to the method that returns the NSData.
chown33 is offline   0 Reply With Quote
Old Nov 5, 2012, 01:10 AM   #3
macrumors 65816
jnoxx's Avatar
Join Date: Dec 2010
Location: Aartselaar // Antwerp // Belgium
I uploaded a zip with source files for MD5 encryption on NSString.

If you put the sourcecode in your application, do the correct #import.
You should be able to call
NSString *md5string = [whateverStringToBeEncrypted md5];
Then your new md5string pointer will contain the md5 encrypted version of whateverStringToBeEncrypted.
Please do mind, there are several different MD5 encryptions, in this case 16 & 32 bit..
They are both in there, just comment the right one out (currently configured for 32 bit).

iPad Mini, iPad 4, iPad 2, iPhone 3G,4,5, iMac 24", Mac Mini Last gen, Macbook Pro Retina with Dell U2711
jnoxx is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iOS7 MD5 hashes Primus84 iOS 7 2 Sep 10, 2013 04:00 PM
How can I allow the tab key only inside a specific div? sk3pt1c Web Design and Development 13 Feb 12, 2013 08:15 AM
Reverse MD5 aware Mac Applications and Mac App Store 1 Jan 2, 2013 11:25 AM
How to read specific key value from plist file saqibjaan Mac Programming 3 Sep 2, 2012 09:27 PM
Resolved: Script for symbolic linking by MD5? comradesnarky Mac Programming 1 Aug 6, 2012 10:05 PM

Forum Jump

All times are GMT -5. The time now is 04:50 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC