Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Is it possible to encrypt/decrypt a value using AES 128, base 64 decoding, random salt and initialization vector?

If so can someone share me the useful links.

share|improve this question
Did you do any research before posting this request for free code? I've voted to close as "not a real question". – Duncan Jones 11 hours ago

2 Answers

Base64 is used to make raw bytes into text, so they can be passed to programs/methods that work with text. It is nothing specifically to do with encryption. A good crypto function will produce raw bytes and Base64 is just a way of representing them as printable text.

Random salt is used for creating secure cryptographic keys. See RCF 5869 for the use of salt in HKDF (HMAC based Key Derivation Function).

An Initialization Vector (IV) is used for AES in CBC mode. The IV does not need to be kept secret and can be prepended to the actual cyphertext when you send it. There will usually be a parameter for the IV in whatever crypto library you are using.

If you require authentication as well as security, then you should look at using an HMAC as well.

share|improve this answer

You can find 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.