encrypt
function defaults to
the strongest cryptographic flags available for GPG.
encrypt(input, output = NULL, passphrase = NULL, compress = "ZLIB", cipher = "AES256", armor = FALSE, mdc = TRUE, s2k.mode = 3, s2k.digest = "SHA512", s2k.count = 65011712, verbosity = 1)
.gpg
or .asc
file extension) in the same folder.NULL
(Insert the passphrase using GPG's secure pop-up box)."Uncompressed"
, "ZIP"
, "ZLIB"
, and "BZIP2"
. Values depend on your GPG installation. The default value is "ZLIB"
."AES256"
, "Camellia256"
, "TWOFISH"
, "AES128"
, etc. Values depend on your GPG installation. The default value is "AES256"
.TRUE
or FALSE
: flag to produce an encrypted ASCII text output file. The default value is FALSE
.TRUE
or FALSE
: flag to force the use of modification detection code. It is always used with newer encryption algorithms and recommended to always keep TRUE
. The default value is TRUE
.0
, 1
, or 3
. Sets how passphrases are mangled. A value of 0
just uses a plain passphrase (never use). A value of 1
will add a salt to the passphrase. A value of 3
will salt and iterate the passphrase. It is highly recommended to always use 3
. The default value is 3
."SHA512"
, "SHA384"
, "SHA256"
, etc. The default value is "SHA512"
.1024
and 65011712
. Specifies how many times the passphrase mangling is repeated. The default value is 65011712
.0
, 1
, 2
, or 3
. Control GPG's terminal message information in increasing level of detail. A value of 0
passes the '--quiet'
flag for a minimum amount of information. A value of 1
does not pass any flags. A value of 2
passes the '--verbose'
flag. A value of 3
passes the '--verbose --verbose'
flag for the most information. The default value is 1
.## Not run:
# encrypt("path/to/your/file.csv")
# encrypt("path/to/your/file.csv", output = "path/to/your/file.csv.gpg")
# # WARNING: only use the passphrase argument if you understand why it's
# # not secure.
# encrypt("path/to/your/file.csv", passphrase = "your-passphrase")
# ## End(Not run)
Run the code above in your browser using DataLab