jeudi 24 septembre 2015

Getting cryptographically secure random numbers in C++ on iOS

I'm working on an iOS app that is written in Objective-C and C++. In the C++ part, I need cryptographically secure random numbers.

  1. As I understand the iOS security model, there is no way to access /dev/random directly. Is that correct?

  2. The official way to get secure random numbers is SecRandomCopyBytes. Sadly, this is an Objective-C interface. Is there a way to use this interface from C++, ideally without resorting to Objective-C++?

There's also arc4random, but I'm reluctant to use anything that's based on RC4 nowadays...




Aucun commentaire:

Enregistrer un commentaire