Jump to content
mitchlang009

Help with Entropy Generation

Recommended Posts

Hello,

So I am working on building a wallet for a project I'm working on.  It is an iOS app and I am running the ripple-lib javascript API in iOS's JavaScriptCore framework. The problem is that brorand (which ripple's API uses to generate random numbers) doesn't play nice with the iOS javascript environment.  So my question is if I generate the entropy in swift and pass the array of numbers to either ripple's generateAddress or generateSeed functions am I okay?  It looks to me like the entropy should be an array of 16 integers, what is the range for the individual integers, 0-256?

Thanks!

Share this post


Link to post
Share on other sites

Depends on where swift gets its random data from I guess. Where's the source code you're using?

If this is already something that you are struggling with a bit (16 bytes of entropy vs. "an array of 16 integers in the range of 0-255"), I'd recommend getting in contact with someone who has implemented and reviewed some cryptography schemes already.

Share this post


Link to post
Share on other sites
6 hours ago, Sukrim said:

Depends on where swift gets its random data from I guess. Where's the source code you're using?

If this is already something that you are struggling with a bit (16 bytes of entropy vs. "an array of 16 integers in the range of 0-255"), I'd recommend getting in contact with someone who has implemented and reviewed some cryptography schemes already.

Thanks Sukrim.  I wasn't sure whether the API took the least significant byte of the integers or whether it had to be an array of bytes.  I found this function https://developer.apple.com/documentation/security/1399291-secrandomcopybytes, which looks to be what I need rather than generating an array of Integers.

Appreciate it!   

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...