[Android Software/Hacking General [Developers Only]] idcrisis:
Hi,

There are just a few things to add, Seeder is based on the premise that a) natural entropy is low and you need an external random number generator service to increase it and while Android provides /dev/random it does not provide a random number generator and b) /dev/random is blocking.

It does something about the first (not all, for that you need the KAK method too) but nothing about the second.

Linking /dev/random to /dev/urandom helps on that front. There will be questions about how much /dev/random is used anyway but that's moot as Seeder won't see so much of a benefit if /dev/random wasn't.

Also Seeder's rngd will go into a nasty high cpu loop if run with the /dev/random pointing to /dev/urandom as it reads from /dev/urandom to feed into /dev/random but with the link it will now feed onto itself.

So Seeder can't be used with /dev/random pointing to /dev/urandom. So combining those methods is not as easy as otherwise tested. I would believe that those tests may have falsely led some to believe that linking /dev/random to /dev/urandom is not a good idea.

But it is if done properly. First you need to create the link (without seeder enabled) which has it's own unique benefits as /dev/random suddenly becomes a non blocking device. Also it's important to remove /dev/random and not just rename it as that shows a difference probably due to file pointers.

Then you do see the entropy levels going down as natural entropy is still low but apps are snappier specially the ssh based communication ones. I'm not too sure how low entropy affects the system with a non blocking /dev/random in place but the logic we use is that if entropy can be increased and no/very less loss of battery life then we should. It doesn't cost anything as we see it.

Here we bring in the KAK wake threshold kernel method to increase entropy naturally to around 3000. Users do report that this method is ok by itself but slightly slower than Seeder alone and the entropy values do speak for themselves. You can see it hovering around 3000 and sometimes going up to 3500+ and test it by touching the screen a lot with the current entropy values showing. You will see an increase.

But you can't really leave it at that and expect that natural entropy is going to cater to all devices. After all the rngd for linux was developed for a reason.

So the rngd from Seeder (it's the linux one) is used. But it is used to feed into a fake /dev/random like device ( as it needs one ) but not /dev/random itself for reasons explained above. This shows to increase entropy for reasons not yet clear to myself.

It is also not needed to feed into this device every 2 seconds and instead it run every 30 seconds.

The result is entropy at 4096 all the time with a non blocking random device. That should suffice for all Android devices out there without any change in logic except for the fact that some devices with their own random number generator eg qrngd should disable that too or at least tested if they go into a high cpu loop as rngd with the link in place.

I would suggest that we look at this method a little closely ( http://xdaforums.com/showthread.php?p=37062006 )

Better yet if we could compile havenged for Android and use that instead of rngd we might be able to not use /dev/urandom at all and then hopefully leave it running feeding into /dev/random instead of /dev/random.fake.

Your thoughts welcome.