Note that there are some explanatory texts on larger screens.

plurals
  1. POAES encryption/decryption for a beginner
    text
    copied!<p>I am trying to encrypt an NSString to both NSString and NSData in Objective-C and so I began a search.</p> <p>I started off <a href="http://robnapier.net/blog/aes-commoncrypto-564" rel="nofollow noreferrer">here</a>, but that went way over my head, unfortunately.</p> <p>I then found myself <a href="https://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone">at this post</a> and it came across to be very easy to follow, so I went along and tried to figure out the <a href="http://pastie.org/426530" rel="nofollow noreferrer">implementation</a>. After looking over the implementation, I saw the second answer in the post and saw he had more adaptable implementations, which brought me to <a href="https://gist.github.com/gonecoding/838614" rel="nofollow noreferrer">his gist</a>. As per the gist readme, he <code>"took down this Gist due to concerns about the security of the encryption/decryption"</code>. That leads me to believe that the security of the implementation from above has security flaws as well.</p> <p>From that gist, however, he mentioned <a href="https://github.com/rnapier/RNCryptor/tree/master/RNCryptor" rel="nofollow noreferrer">another alternative</a> that I could use for encryption. After taking a look at the code, I noticed that it generates NSData with <code>"a header, encryption salt, HMAC salt, IV, ciphertext, and HMAC"</code>. I know how to handle that to decode using the same library again, but how would I pass this off to a server guy, given that I don't quite know what I'm sending to him?</p> <p>At the root of it all, I'm in over my head. Given what I said above and knowing that I don't have the time to take on a lot of learning for this, unless if it is absolutely necessary, how should I best handle going about this encoding/decoding process, given a private key with the end goal of shipping it off to a server that is not designed by me? (How's that for a run on sentence!)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload