Created
May 9, 2018 16:46
-
-
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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