Skip to content

Instantly share code, notes, and snippets.

@dennisliub
Created May 9, 2018 16:46
Show Gist options
  • Save dennisliub/3623e6b0d7e0010ad4f4ca1ce3d55813 to your computer and use it in GitHub Desktop.
Save dennisliub/3623e6b0d7e0010ad4f4ca1ce3d55813 to your computer and use it in GitHub Desktop.
How do I encrypt specific variables/columns in a data frame in R?
require(PKI)
key <- PKI.genRSAkey(2048)
x <- charToRaw("Hello, world!")
e <- PKI.encrypt(x, key)
y <- PKI.decrypt(e, key)
stopifnot(identical(x, y))
print(rawToChar(y))
# https://www.quora.com/How-do-I-encrypt-specific-variables-columns-using-SHA-1-in-a-data-frame-in-R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment