Can i get link for AES-128 Bit Algorithm any sample code please help
-
2possible duplicate of http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone – kennytm May 05 '10 at 14:50
-
Possible this method can help you http://stackoverflow.com/questions/36997088/i-want-to-create-aes-128-using-cfb-encryption-with-no-padding-in-objective-c/37019462#37019462 – Girijesh Kumar May 04 '16 at 10:09
4 Answers
AES-128 is already implemented in the Security framework and CommonCrypto API for the iPhone. This site contains some sample code using this to encrypt a message.
You can also find sample code on Apple's website that makes use of this and provides some Objective-C wrappers.

- 8,202
- 2
- 36
- 42
Quite a few are written in C or C++ that you should be able to use in the iPhone, though I don't know of any that is written in Objective C as such. Note that in most (if not all) cases, the AES code itself is just one part of a larger library that attempts to include enough to actually make the cryptographic algorithm itself useful and usable.

- 476,176
- 80
- 629
- 1,111
I think you want to use CCCryptor and not roll your own methods.

- 7,932
- 11
- 44
- 64
-
i am using CC_SHA224_DIGEST_LENGTH how long should be the key for this when we use md5 16 bit long key we have to use now for this how long should be the key – madhavi May 06 '10 at 10:37
This may be a bit trite, but it's not hard to implement AES yourself. I've done it in a couple of hours. The official specification is here.

- 242,470
- 58
- 448
- 498
-
While this is true, and I've implemented it myself as well, using an existing AES implementation from a library is generally smarter and safer. +1 for linking to the specification, though. – Quinn Taylor May 05 '10 at 17:34
-
1Using an existing library is always better unless it doesn't work AND it's not open source (i.e. it's broken and you can't fix it). I'm always frustrated by people who roll their own solution unnecessarily. – Adam Nelson May 06 '10 at 16:46