You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tarcieri edited this page Feb 15, 2013
·
2 revisions
There are some helpful functions for performing common tasks in cryptography. These include random data generation (for example, for key material) using the operating system random source and constant-time comparisons of strings, to avoid exposing information through timing attacks.
# random stringsCrypto::Random.random_bytes(32)#=> 32 bytes of randomness, from the OS# constant time comparisons.Crypto::Util.verify32(string_one,string_two)#=> true/false. See also verify16