Documentation: http://randy3k.github.io/otp
Generating and validating One-time Password based on Hash-based Message Authentication Code (HOTP) and Time Based One-time Password (TOTP) according to RFC 4226 https://tools.ietf.org/html/rfc4226 and RFC 6238 https://tools.ietf.org/html/rfc6238.
You can install the released version of otp from CRAN with:
And the development version from GitHub with:
p <- TOTP$new("JBSWY3DPEHPK3PXP")
(code <- p$now())
#> [1] "467326"
p$verify(code)
#> [1] "2020-04-30 21:59:30 PDT"
raster::image(
qrencoder::qrencode_raster(p$provisioning_uri("otp")),
asp = 1, col = c("white", "black"), axes = FALSE,
xlab = "", ylab = ""
)