security - iOS App Data Encryption with Public / Private Keys -



security - iOS App Data Encryption with Public / Private Keys -

i new subject, , appreciate help / direction on how implement public / private key encryption ios applications. looks security framework need want create sure have best advise.

basically, user , user b want communicate securely. user have user b public key, , utilize encrypt message. user b gets message , decrypts private key.

so guess questions are:

what best way generate public / private keys. openssl?

if openssl, there way within ios device, or need rely on server / outside generation private / public keys?

if generating private / public keys outside ios device option, simple matter of making ios device request key files through http, normal download?

when users have publica , private keys, there simple tutorial / illustration showing how encrypt , decrypt message using rsa (is rsa alternative btw)?

avoid openssl if possible, utilize apple crypto methods on osx/ios. on server side openssl may best bet. you can utilize https transfer keys safely. the next links provide illustration code:

to generate keys utilize seckeygeneratepair() see so question illustration code.

to keys transport utilize secitemcopymatching () see so answer illustration code.

for illustration code perform rsa encryption see so answer

notes:

the private/public key generated on same machine. public key can , openly shared issue authenticate public key. https viable way transfer keys.

generally info not encrypted/decrypted pubic/private keys. couple of reasons: slow, has limited info size (limited key size). info encrypted symmetric methods such aes , random key , key encrypted public key, sent , decrypted private key. key used decrypt aes encrypted actual data.

openssl no longer provided apple, need version of source , build yourself. stated reason not providing openssl minor versions not backward compatible , created issues when apple supplies current version , developers have apps using incompatible older version.

for tutorial: google it.

ios security encryption

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -