- 概要
- 暗号化
- データベース
- Java
- Python
- Web API
開発者向けのアクティビティ
UiPath.Cryptography.Activities.EncryptFile
説明
Encrypts a file using a symmetric algorithm and key, or using PGP with a recipient's public key. The result is written to a new file.
プロジェクトの対応 OS
Windows - レガシ | Windows | クロスプラットフォーム
Windows、クロスプラットフォームでの設定
- ファイル - 暗号化するファイルです。
IResource型変数に格納されます。プラス記号
のメニューを選択して、[入力パス] の入力に切り替えます。 - Algorithm - A drop-down menu which enables you to select the encryption algorithm you want to use. The following options are available: AES GCM, ChaCha20-Poly1305 (Non-FIPS), PGP - Pretty Good Privacy (Non-FIPS), AES (Deprecated), DES (Deprecated), RC2 (Non-FIPS) (Deprecated), Rijndael (Non-FIPS) (Deprecated), and TripleDES (Deprecated). AES GCM and ChaCha20-Poly1305 (Non-FIPS) are authenticated (AEAD) algorithms recommended for new workflows. Select PGP to encrypt with a recipient's public key instead of a symmetric key.
- Key - The key that you want to use to encrypt the file. Used by the symmetric algorithms only. This field supports only strings and
Stringvariables. To enter the key as a secure string instead of plain text, select the field's input menu and choose Toggle to Secure input - this uses the Key Secure String property (aSecureString).
詳細オプション
オプション
- Key Encoding - The encoding used to interpret the key specified in the Key property. The dropdown lists all text encodings (code pages) available on the machine, with the most common ones shown first: System default, Unicode (UTF-8) (default), Unicode, Unicode (Big-Endian), Unicode (UTF-32), Unicode (UTF-32 Big-Endian), US-ASCII, and Western European (ISO). Additional regional and legacy code pages follow in the list.
- 出力ファイル名と場所 - 暗号化したファイルを保存するパスです。このフィールドは、文字列と
String型変数のみをサポートします。注:Windows マシンと Linux マシンではプロジェクトを実行する際にファイル構造が異なるため、相対フォルダー パスを使用することをお勧めします。相対パスは、
newFolder/newFileName.encの形式に従います。ターゲット フォルダーがまだ存在しない場合は、アクティビティによって作成されます。 - 上書き - [オン] を選択すると、ファイルが既に存在する場合、上書きします。このトグルを [オフ] に設定すると、新しいファイルが作成されます。既定値は [オフ] です。
- エラー発生時に実行を継続 - アクティビティでエラーが発生した場合でも、オートメーションを継続するかどうかを指定します。このフィールドでは Boolean 値 (
True、False) のみサポートされています。既定値はFalseです。その結果、フィールドが空白の場合にエラーが発生すると、プロジェクトの実行が停止します。値をTrueに設定すると、プロジェクトの実行はエラーに関係なく継続されます。
Symmetric wire format and interoperability
These options apply to the symmetric algorithms only. They let you produce ciphertext that interoperates with external tools such as openssl enc, Java, and Python. Existing workflows that do not set Wire format keep producing the default Classic output, which is unchanged.
- Wire Format - The symmetric ciphertext layout. The following options are available:
- UiPath (Classic) (default) - UiPath's byte-stable layout (
salt(8) + IV + ciphertext [+ tag], PBKDF2-HMAC-SHA1 at 10,000 iterations). Produces the same output as previous versions. - UiPath (OWASP 2026) - The Classic layout with a stronger, OWASP-recommended KDF iteration count.
- Raw (caller-supplied key and IV) - A caller-supplied key and IV, for third-party interoperability. Requires Key Bytes Format to be Hex or Base64.
- OpenSSL enc (Salted__ + PBKDF2-SHA256) - Produces
openssl enc-compatible output.
- UiPath (Classic) (default) - UiPath's byte-stable layout (
- Key Bytes Format - How the Key string is interpreted. The following options are available: Hex and Base64. Required when Wire Format is Raw (caller-supplied key and IV); otherwise the key is treated as a password.
- IV - The initialization vector, used when Wire Format is Raw (caller-supplied key and IV). Interpreted according to Key Bytes Format. Optional - leave it empty to let the cipher generate one. Rejected for all other formats.
- KDF Iterations - The PBKDF2 iteration count.
0uses the format's OWASP-recommended default (1,300,000 for UiPath (OWASP 2026), 600,000 for OpenSSL enc). Rejected for UiPath (Classic) and Raw (caller-supplied key and IV). - AES Key Size - The AES key size, in bits. The following options are available: 128-bit, 192-bit, and 256-bit (default). Applies only when Algorithm is AES and Wire Format is OpenSSL enc (Salted__ + PBKDF2-SHA256). Must match the key size the peer uses. It is not stored in the wire format, so the encrypt and decrypt sides must use matching values.
PGP
These options apply when Algorithm is PGP.
- Public Key File Path - The path to the recipient's PGP public key file. Required when Algorithm is PGP.
- Private Key File Path - The path to your PGP private key file. Required only when Sign Data is enabled.
- Passphrase - The passphrase that unlocks your private key when signing. To provide it as a secure string instead of plain text, select the field's input menu and switch to the Passphrase (Secure) input (a
SecureString). - Sign Data - When enabled, signs the encrypted data using your private key. This field only supports Boolean values (
True,False). The default value isFalse.
出力パス、およびファイルが既に存在するかどうかに応じて、次の結果が発生する可能性があります。
| 出力ファイル名と場所 | 上書き | 出力結果です |
|---|---|---|
| 未設定 | Off | 元のファイル名にサフィックス「_Encrypted」が付いたファイル。 ファイルが既に存在する場合は、エラーがスローされます。 |
| 未設定 | On | 元のファイル名にサフィックス「_Encrypted」が付いたファイル。 ファイルが既に存在する場合、ファイルは上書きされます。 |
| Set | Off | ユーザーの設定に応じたファイル。 ファイルが既に存在する場合は、エラーがスローされます。 |
| Set | On | ユーザーの設定に応じたファイル。 ファイルが既に存在する場合、ファイルは上書きされます。 |
出力
- Encrypted File - Reference to the encrypted file retrieved by the activity for use in other activities.
Windows - レガシでの設定
プロパティ パネル
共通
- エラー発生時に実行を継続 - アクティビティでエラーが発生した場合でも、オートメーションを継続するかどうかを指定します。このフィールドでは Boolean 値 (
True、False) のみサポートされています。既定値はFalseです。その結果、フィールドが空白の場合にエラーが発生すると、プロジェクトの実行が停止します。値をTrueに設定すると、プロジェクトの実行はエラーに関係なく継続されます。注:このアクティビティが [トライ キャッチ] に含まれていて、[エラー発生時に実行を継続] プロパティの値が
Trueである場合、プロジェクトの実行時にエラーが捕捉されません。 - 表示名 - アクティビティの表示名です。
入力
-
アルゴリズム - 使用する暗号化アルゴリズムを選択するためのドロップダウン メニューです。利用可能なオプションは、AES (非推奨)、AES GCM、DES (非推奨)、RC2 (非 FIPS) (非推奨)、Rijndael (非 FIPS) (非推奨)、TripleDES です。
注:AES GCMアルゴリズムを使用する場合、復号化入力は(連結バイト)の形式で指定する必要があります。
Salt (8bytes) + IV (12 bytes) + encryptedData (variable bytes) + Tag (16 bytes)。このアクティビティでは、次のパラメーターも使用します。- PBKDF2 の反復回数は 10000 です。
- 生成されるキーは 256 ビット (32 バイト) です。
256 ビットで生成されるキーは、[キー] 入力オプションと同じではないことに注意してください。
-
暗号化後のファイル名 - 暗号化後のファイルを保存する際に使用するファイル名です。
-
入力パス - 暗号化するファイルのパスです。このフィールドは、文字列と
String型変数のみをサポートします。 -
キー - 指定したファイルの暗号化に使用するキーです。このフィールドは、文字列と
String型変数のみをサポートします。 -
キーのエンコード - [キー] プロパティに指定するキーの解釈に使用するエンコードです。このフィールドでは
Encoding型の変数のみがサポートされています。 -
キー (SecureString) - 入力ファイルの暗号化に使用する、セキュリティで保護された文字列です。
-
出力ファイル名と場所 - 暗号化したファイルを保存するパスです。このフィールドは、文字列と
String型変数のみをサポートします。 -
上書き - [出力パス] フィールドに指定するパスにファイルが存在する場合、このチェック ボックスをオンにすると、既存のファイルが上書きされます。チェックをオフにすると、新しいファイルが作成されます。既定では、このチェック ボックスはオフに設定されています。
その他
- プライベート - オンにした場合、変数および引数の値が Verbose レベルでログに出力されなくなります。