0

I am using the digest function to mask some sensitive information in R. Is it possible to retrieve the original data after masking?

Any insights would be highly appreciated.

Thanks Priyanka

  • 1
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input. We have no idea what your code does so it's hard to say for sure what's going on. – MrFlick Jun 18 '18 at 16:24

1 Answers1

1

No it's not possible. If you just need to hide the data from plain sight, you can use base 64 encoding. E.g.:

library(base64enc)

x <- "sensitive data"
x64 <- base64enc::base64encode(charToRaw(x))
print(x64)
[1] "c2Vuc2l0aXZlIGRhdGE="

rawToChar(base64decode(x64))

[1] "sensitive data"

Otherwise, you can use encryption, which there are packages for.

thc
  • 9,218
  • 1
  • 21
  • 36