Encrypt Example"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(deident)

The most direct method of removing identifiability is via 'encryption' which comprises two processes:

  1. The 'salting' of a string by appending a given, unknown string.
  2. The 'hashing' of the resulting string via an encryption method e.g. MD5 or sha256.

This approach is implemented via the Encrypter methods (which uses the openssl::sha256 implementation by default):

name_pipe <- starwars |> 
  add_encrypt(name, hash_key = "hash123", seed="seed456")

apply_deident(starwars, name_pipe)


Try the deident package in your browser

Any scripts or data that you put into this service are public.

deident documentation built on April 3, 2025, 6:14 p.m.