Unified random number provider
- not used yet, just an inactive helper function - I received feedback that OpenSSL.rand isn't more secure than os.urandom. I read several debates/analyses about it and concur
This commit is contained in:
parent
70c5929e92
commit
27f5de0f9c
9
src/helper_random.py
Normal file
9
src/helper_random.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import os
|
||||
|
||||
from pyelliptic.openssl import OpenSSL
|
||||
|
||||
def randomBytes(n):
|
||||
try:
|
||||
return os.urandom(n)
|
||||
except NotImplementedError:
|
||||
return OpenSSL.rand(n)
|
Reference in New Issue
Block a user