enc_file: Read and write encrypted files

Description Usage Arguments Value Examples

Description

Read and write encrypted files

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
read_enc_ascfile(
  filename,
  decode = T,
  key = "1VerySecretPasword",
  trans = "cfcvp"
)

write_enc_ascfile(
  text,
  filename,
  encode = T,
  key = "1VerySecretPasword",
  trans = "cfcvp"
)

read_enc_binfile(
  filename,
  decode = T,
  key = "1VerySecretPasword",
  trans = "cfcvp",
  bufsize = 2000,
  raw2char = F
)

write_enc_binfile(
  text,
  filename,
  encode = T,
  key = "1VerySecretPasword",
  trans = "cfcvp"
)

Arguments

filename

a connection() object or a character string for use in readLines() or writeLines()

decode

Logical scalar indicating if decoding should be done (if TRUE)

key

Character string with key for the xcode() function

trans

Character string with the transformations to be done by the xcode() function#'

text

Character string that has to be written

encode

Logical scalar indicating if encoding should be done (if TRUE)

bufsize

Integer indicating the buffersize to be used for read_enc_binfile

raw2char

Logical scalar indicating if rawToChar conversion should be done in read_enc_binfile

Value

Character string with the data read in case of the read_enc_ascfile function otherwise NULL.

Examples

1
2
3
4
5
6
7
8
## Not run: 
han<- write_enc_ascfile("han",'mycoded.txt')
read_enc_ascfile('mycoded.txt',decode = FALSE)
# [1] "L7Gq 63aiI7x92kx"
read_enc_ascfile('mycoded.txt',decode = TRUE)
# [1] "han"

## End(Not run)

HanOostdijk/HOQCenc documentation built on Dec. 17, 2021, 10:28 p.m.