Scrypt work factor analysis on EC2.

Goal: Find an appropriate work factor for Scrypt on EC2.

Scrypt is useful to protect passwords as explained quite adequately by Wikipedia.

To properly use scrypt its work factor should be tuned to adequately protect the password, but also be able to calculate the derived output withing a suitable window of time. Since I primarily run my application on AWS's EC2, its best to determine the rate at which a typical EC2 instance (m1.medium) can process scrypt_hash() calls from Crypt::ScryptKDF.

Work FactorRate
153.03/s
147.32/s
1314.8/s
1229.6/s
1159.2/s
10117/s
9228/s
8439/s
7820/s

The code: