The deidentify_text method offers a flexible approach to encryption offering the user the option to encrypt text columns using either openssl or sodium. The encryption path chosen depends on the encryption key generated by the user. For example, if a user generates an aes_key, and passes it to deidentify_text, aes encryption will be automatically applied. The function will return a dataframe with the an encrypt_id suffix added to the end of the column name. Thus, a user will have to actively remove the unencrypted columns manually.

deidentify_text(.data, cols_to_encrypt, key = NULL)

Arguments

.data

a data frame

cols_to_encrypt

A character vector with the names associated with the columns to encrypt

key

A cyphr key generated from the cyphr package

Value

A Dataframe with encrypted columns ending with the prefix 'encrypt_id'

Examples

if (FALSE) { data("initiations") aes_key <- gen_aes_key(24) deidentify_text(initiations,"case_participant_id",aes_key) }