| Title: | Key Derivation Functions for R Based on Scrypt |
|---|---|
| Description: | Functions for working with the scrypt key derivation functions originally described by Colin Percival <https://www.tarsnap.com/scrypt/scrypt.pdf> and in Percival and Josefsson (2016) <doi:10.17487/RFC7914>. Scrypt is a password-based key derivation function created by Colin Percival. The algorithm was specifically designed to make it costly to perform large-scale custom hardware attacks by requiring large amounts of memory. |
| Authors: | Bob Jansen [ctb, cre], Andy Kipp [aut], Colin Percival [aut, cph], RStudio [cph] |
| Maintainer: | Bob Jansen <[email protected]> |
| License: | FreeBSD |
| Version: | 0.1.5 |
| Built: | 2026-05-21 09:27:44 UTC |
| Source: | https://github.com/bobjansen/rscrypt |
scrypt is an R package for working with scrypt. Scrypt is a password-based key derivation function created by Colin Percival. The algorithm was specifically designed to make it costly to perform large-scale custom hardware attacks by requiring large amounts of memory.
| Package: | scrypt |
| Type: | Package |
| Version: | 0.1 |
| Date: | 2014-01-07 |
| License: | GPLv3 |
The scrypt package can be used for hashing and verifying passwords, or encrypting and decrypting data. Additionally, the scrypt function can be used directly.
RStudio, Inc.; Colin Percival Maintainer: Andy Kipp <[email protected]>
hashPassword, verifyPassword and scrypt
Hash a password
hashPassword(passwd, maxmem = 0.1, maxtime = 1)hashPassword(passwd, maxmem = 0.1, maxtime = 1)
passwd |
password to hash |
maxmem |
max memory percent (default 0.1) |
maxtime |
max cpu time (default 1.0) |
base64 encoded hash
# Hash password using default parameters hashPassword('passw0rd') # Hash password with custom parameters hashPassword('passw0rd', maxmem=0.25, maxtime=1.0)# Hash password using default parameters hashPassword('passw0rd') # Hash password with custom parameters hashPassword('passw0rd', maxmem=0.25, maxtime=1.0)
Verify a hashed password
verifyPassword(hash, passwd)verifyPassword(hash, passwd)
hash |
base64 hash to verify |
passwd |
password to verify |
TRUE if password matches hash, otherwise FALSE
# Hash password using default parameters hashed <- hashPassword("password") # verify invalid password verifyPassword(hashed, "bad password"); # verify correct password verifyPassword(hashed, "password")# Hash password using default parameters hashed <- hashPassword("password") # verify invalid password verifyPassword(hashed, "bad password"); # verify correct password verifyPassword(hashed, "password")