Cryptography - Encrypt

 

Declaration

<AMCRYPTOGRAPHY ACTIVITY="encrypt" SUBFOLDERS="yes/no" KEEPFOLDERSTRUCT="yes/no" OVERWRITE="yes/no" ISNEWER="yes/no" ONLYIFEXIST="yes/no" OVERWRITEREADONLY="yes/no" OVERWRITEHIDDEN="yes/no" ARCHIVETURNOFF="yes/no" MATCHCASE="yes/no" EXCLUDE="text" RE="yes/no" INPUTFILE="text" OUTPUTFILE="text" RESULTDATASET="text" PASSPHRASE="text (encrypted)" USEOLDPACKETS="YES/NO" SELFEXTRACT="YES/NO" TAR="YES/NO" ARMOR="YES/NO" COMPRESSIONALGO="text (potions)" APPENDEXTENSION="text" />

Related Topics    

Description

Encrypts one or more files using the specified encryption method and algorithm. This action supports both symmetric (passphrase) and asymmetric (public/private key) encryption types. If PGP is installed, this action can optionally use the PGP engine for both passphrase and public/private key encryption and support for a wide variety of encryption algorithms.

NOTE: PGP (Pretty Good Privacy) is a popular program used to encrypt and decrypt e-mail over the Internet. It can also be used to send an encrypted digital signature that lets the receiver verify the sender's identity. AutoMate comes bundled with the OpenPGP engine which is based on PGP as originally developed. OpenPGP is installed on the system during AutoMate installation.

Practical Usage

Used for security purposes to encrypt any type of file. Ideal for keeping sensitive and confidential information private.

Parameters

General

Property

Type

Required

Default

Markup

Description

Source

Text

Yes

(Empty)

  1. INPUTFILE="c:\folder\file.txt"

  2. INPUTFILE="c:\folder\*.txt"

The path and file name of the file(s) to encrypt. Supports wildcard characters (* or ?) to encrypt files matching a certain mask. See File Masks & Wildcards for more details.

Destination

Text

Yes

(Empty)

  1. OUTPUTFILE="c:\Folder\file.txt"

  2. OUTPUTFILE="c:\DestFolder\

The destination folder and (optional) file name to place the newly encrypted file(s). Folders that do not exist will be automatically created at runtime.

Create and populate encrypt dataset

Text

Yes

(Empty)

  1. RESULTDATASET="text"

The name of the dataset to create and populate with encryption data.

 

Encrypt

Property

Type

Required

Default

Markup

Description

Encryption type

Text (Options)

No

passphrase

  1. ENCRYPTTYPE="openpgppassphrase"

  2. ENCRYPTTYPE="openpgpkey"

  3. ENCRYPTTYPE="pgppassphrase"

  4. ENCRYPTTYPE="openpgpkey"

  5. ENCRYPTTYPE="passphrase"

  6. ENCRYPTTYPE="key"

The type of encryption to be performed. Parameters vary depending on which encryption type is selected. The Available options are:

  • OpenPGP passphrase (Default) - Requires a particular passphrase to verify and encrypt the specified file(s).

  • OpenPGP public key -  Encryption is performed using OpenPGP public key and can only be encrypted with the corresponding private key.

  • PGP Passphrase - Requires a particular PGP passphrase to encrypt.

  • PGP public key - Uses a system which binds the public keys to an e-mail address. Requires the associated PGP private key to encrypt.

  • Passphrase - Requires a particular OpenPGP passphrase to encrypt.

  • Public key - An asymmetric form of encryption that relies on a cryptographically generated public/private key pair. Encryption is performed with the public key and can only be encrypted with the corresponding private key.

Symmetric algorithm

Text (Options)

Yes if Encryption type set to OpenPGP passphrase, OpenPGP public key, PGP Passphrase or Passphrase

Rijndael

  1. ENCRYPTALGO="des"

  2. ENCRYPTALGO="rc2"

  3. ENCRYPTALGO="tripledes"

The encryption algorithm to use. This parameter is active only if Encryption type parameter is set to OpenPGP passphrase, OpenPGP public key, PGP Passphrase or Passphrase.

Available encryption algorithm options for OpenPGP passphrase, OpenPGP public key or PGP Passphrase are:

  • Plain text

  • IDEA (PGP Only)

  • TripleDES

  • CAST5 (default)

  • BLOWFISH

  • AES128

  • AES192

  • AES256

  • TWOFISH256

Available encryption algorithm options for Passphrase are:

  • Rijndael (Default)

  • DES

  • RC2

  • TripleDES

Passphrase

Text

Yes if Encryption type set to OpenPGP passphrase, PGP passphrase or Passphrase

(Empty)

PASSWORD="encrypted"

The passphrase to use in order to encrypt the file(s). This parameter is available only if the Encryption type parameter is set to OpenPGP passphrase, PGP passphrase or Passphrase.

Public keyring file(s)

Text

Yes if Encryption type set to OpenPGP public key or PGP public key

(Empty)

PUBKEYRINGPATH=

"c:\foldername\file.pkr"

Specifies the path and filename of the PGP or OpenPGP public keyring file. Entering a valid public keyring file along with a matching secret keyring file will populate the Recipient(s) section with the appropriate signature information when pressing the Select recipient(s) button. This parameter is active only if the Encryption type parameter is set to OpenPGP public key or PGP public key.

Secret keyring file(s)

Text

Yes if Encryption type set to OpenPGP public key or PGP public key

(Empty)

SECKEYRINGPATH=

"c:\foldername\file.skr"

Specifies the path and filename of the PGP or OpenPGP secret keyring file. Entering a valid public keyring file along with a matching secret keyring file will populate the Recipient(s) section with the appropriate signature information when pressing the Select recipient(s) button. This parameter is active only if the Encryption type parameter is set to OpenPGP public key or PGP public key.

Recipient(s) Email or Name

Text

Yes if Encryption type set to OpenPGP public key or PGP public key

(Empty)

EMAIL="Jay@netauto.com"

Indicates the e-mail address and/or unique name in which to bind the OpenPGP public key to. Click Select recipient(s) to populate this field with the recipient email and/or name. Multiple names/email addresses can be entered by separating each entry with a semi-colons (;). This parameter is active only if the Encryption type parameter is set to OpenPGP public key.

Key email

Text

Yes if Encryption type set to PGP public key

(Empty)

EMAIL="admin@netauto.com"

Specifies the e-mail address in which to bind the PGP public key to. This parameter is active only if the Encryption type parameter is set to PGP public key.

Encrypt using

Text (Options)

Yes for Public/Private Key encryption method

Key Container

  1. ENCRYPTUSING="KEYCONTAINER"

  2. ENCRYPTUSING="KEYCFILE"

Indicates the encryption procedure to be used to encrypt the specified file(s). This parameter is active only if the Encryption type parameter is set to Public key. The available options are:

  • Key container - A key container will be used to encrypt the file(s).

  • Key file - A key file will be used to encrypt the file(s). Click the Folder icon to navigate to the appropriate private key (.pri) file or simply enter the full path and filename of the private key file in the provided text-box.

Key container name

Text

Yes if Encrypt using parameter set to Key container

(Empty)

KEYCONTAINERNAME=

"Microsoft Enhanced Cryptographic Provider v1.0"

Specifies the name of the key container to be used. Clicking the down arrow will display a list of cryptographic provider names to select from. This parameter is active only if the Encrypt using parameter is set to Key container.

Public key path

Text

Yes if Encrypt using parameter set to Key file

(Empty)

KEYCONTAINERNAME=

"C:\Temp\filename.pri"

Specifies the path and filename of the public key file to be used. Click the Folder icon to navigate to the appropriate key file or simply enter the full path and filename of the key file in the provided text-box. This parameter is active only if the Encrypt using parameter is set to Key file.

Armor data

Yes/No

No

No

ARMOR="YES"

If set to YES, causes PGP or OpenPGP to enable ASCII Armor output, a form of encoding binary data in a sequence of ASCII-printable characters. Binary to text encoding is necessary for transmission of data when the channel or the protocol only allows ASCII-printable characters, such as transporting through email channels. If you intend to use PGP primarily for email purposes, we suggest enabling this option. This parameter is active only if the Encryption type parameter is set to OpenPGP passphrase, PGP passphrase or PGP public key.

Compress data before encryption

Yes/No

No

Yes

COMPRESS="YES"

If set to YES, specifies that the file(s) will be initially compressed before encryption is performed. This parameter is active only if the Encryption type parameter is set to OpenPGP passphrase, PGP passphrase or PGP public key.

file options

Property

Type

Required

Default

Markup

Description

Include Subfolders

Yes/No

No

No

SUBFOLDERS="YES"

If set to YES, specifies that, if present, subfolders should be searched for files matching the mask specified in the Source parameter. The default value is set to NO.

Preserve Folder Structure

Yes/No

No

Yes

KEEPFOLDERSTRUCT="NO"

If set to YES, specifies that subfolders found in the source folder should be created in the destination folder, and source files should be encrypted into their respective folders rather than directly into the root of the folder specified in the Destination parameter. Valid only if the Include subfolder parameter is set to YES.

Overwrite if Exists

Yes/No

No

No

OVERWRITE="YES"

If set to YES, specifies that, if destination files already exist, they should be overwritten. The default value is set to NO.

Only if Newer

Yes/No

No

No

ISNEWERTHAN="YES"

If set to YES, indicates that only files that are newer than those in the destination folder will overwrite existing files. Valid only if the Overwrite if Exists parameter is set to YES.

Only if Exists in Destination

Yes/No

No

No

ONLYIFEXIST="YES"

If set to YES, specifies that only files that already exist in the destination will be encrypted from the source. All other files, regardless of whether they match the mask or other parameter settings will be bypassed. Valid only if the Overwrite if Exists parameter is set to YES.

Overwrite Read-Only Files

Yes/No

No

No

OVERWRITEREADONLY="YES"

If set to YES, indicates that already existing files should be overwritten even if the file in the destination is marked with the "read-only" attribute. By default, read only files are not overwritten. Valid only if the Overwrite if Exists parameter is set to YES.

Overwrite Hidden Files

Yes/No

No

No

OVERWRITEHIDDEN="YES"

If set to YES, specifies that already existing files should be overwritten even if the file in the destination is marked with the "hidden" attribute. By default, hidden files are not overwritten. Valid only if the Overwrite if Exists parameter is set to YES.

Turn Archive Attribute Off

Yes/No

No

No

ARCHIVETURNOFF="YES"

If set to YES, denotes that the "archive" attribute of the source file should be switched OFF. The Windows "archive" attribute is generally used to track whether a file has been backed-up. By turning the source file's archive attribute off—this indicates to many backup programs that the file has already been backed-up.

Exclude Mask

Text

No

(Empty)

EXCLUDE="*.txt"

Causes this action to omit encrypting files matching the mask(s) specified. Filenames or wildcard masks may be used. Multiple entries may be specified by separating them with a pipe symbol (|). For example: *.txt|*.bak.

Regular Expression

Yes/No

No

No

RE="YES"

If set to YES, specifies that a regular expression is used in the Exclude Mask field.

Only if Newer Than

Date

No

(Empty)

ISNEWERTHAN=

"%DateSerial(2007,10,12) + TimeSerial(00,00,00)%"

Causes this action to only encrypt files if the source is newer than the date/time specified. If this parameter is left blank or not included, the date of the file(s) will be ignored (excluding Only if newer parameter).

Only if Older Than

Date

No

(Empty)

ISOLDERTHAN=

"%DateSerial(2007,10,12) + TimeSerial(00,00,00)%"

Causes this action to only encrypt files if the source is older than the date/time specified. If this parameter is left blank or not included, the date of the file(s) will be ignored (excluding Only if newer parameter).

Attributes

Property

Type

Required

Default

Markup

Description

Attributes

Text Options

No

(Empty)

ATTRFILTER="+R+A-H" (encrypt read-only & archive files but not hidden files)

This group of settings causes the action to filter which files are encrypted based on the attribute settings of the source file(s). In visual mode, a group of controls are provided to assist in the selection of this parameter. In markup mode, a single text item must be specified that contains the attributes of the files you wish to encrypt. The available options are:

  • R—Read-only: Specifying "+R" causes files with this attribute turned on to be included, "-R" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • A—Archive: Specifying "+A" causes files with this attribute turned on to be included, "-A" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • S—System: Specifying "+S" causes files with this attribute turned on to be included, "-S" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • H—Hidden: Specifying "+R" causes files with this attribute turned on to be included, "-H" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • C—Compression: Specifying "+C" causes files with this attribute turned on to be included, "-C" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

 

Description

Error Causes

On Error

additional notes

Comparing Machine-Level and User-Level RSA Key Containers

User-level RSA key containers are stored with the Windows user profile for a particular user and can be used to encrypt and encrypt information for applications that run under that specific user identity. User-level RSA key containers can be useful if you want to ensure that the RSA key information is removed when the Windows user profile is removed. However, because you must be logged in with the specific user account that will make use of the user-level RSA key container in order to encrypt or decrypt protected configuration sections, they are inconvenient to use.

Machine-level RSA key containers are available to all users that can log in to a computer, by default, and are the most useful as you can use them to encrypt or decrypt protected configuration sections while logged in with an administrator account. A machine-level RSA key container can be used to protect information for a single application, all the applications on a server, or a group of applications on a server that run under the same user identity. Although machine-level RSA key containers are available to all users, they can be secured with NTFS Access Control Lists (ACLs) so that only required users can access them.

examples

Example 1: Passphrase Encryption

 

<AMCRYPTOGRAPHY ACTIVITY="encrypt" SUBFOLDERS="yes" KEEPFOLDERSTRUCT="yes" OVERWRITE="yes" ISNEWER="yes" INPUTFILE="C:\SourceFolder\*.DOC" OUTPUTFILE="C:\DestinationFolder\encr*.doc" ENCRYPTTYPE="passphrase" PASSPHRASE="AM3hbDcFIyZYZs=aME" ATTRFILTER="+r" />

 

 

Example 2: Public/Private Key Encryption

 

<AMCRYPTOGRAPHY ACTIVITY="encrypt" SUBFOLDERS="yes" KEEPFOLDERSTRUCT="yes" OVERWRITE="yes" ISNEWER="yes" INPUTFILE="C:\SourceFolder\*.DOC" OUTPUTFILE="C:\DestinationFolder\encr*.doc" ENCRYPTTYPE="key" KEYCONTAINERNAME="Microsoft Enhanced Cryptographic Provider v1.0" KEYCONTAINERLEVEL="user" ATTRFILTER="+r" />