Closed dmenne closed 3 years ago
Hello.... any comment?
Hello,
You can hash the password yourself if you want to customize the hash function:
credentials <- data.frame(
user = c("shiny", "shinymanager"),
password = c("azerty", "12345"),
stringsAsFactors = FALSE
)
# Hash your password with parameter you want
credentials$password <- sapply(credentials$password, scrypt::hashPassword, maxmem = 0.1, maxtime = 1)
# add a column is_hashed_password to indicate that password is hashed
credentials$is_hashed_password <- TRUE
# Create the database
create_db(
credentials_data = credentials,
sqlite_path = "database.sqlite", # will be created
passphrase = "key"
)
# check if it's working
check <- check_credentials(db = "database.sqlite", passphrase = "key")
check("shiny", "azerty")
Victor
The standard block below to check credentials needs 3 seconds on my very fast computer, which is too long for users.
I know that this is for security, but how can I reduce the planned slowness of crypt?
Make
maxtime
an optional variable:hashPassword(passwd, maxmem = 0.1, maxtime = 1)