--- title: "PGP Encrypt String" slug: "pgp-encrypt-string" updated: 2023-09-07T22:07:00Z published: 2023-09-07T22:07:00Z canonical: "documentation.decisions.com/pgp-encrypt-string" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Encrypt String | Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | | | **Location** | PGP Steps | The Encrypt String steps allows the user to encrypt String data from a flow and assign it a Public Key. ### Prerequisites This step requires the [PGP Module](https://documentation.decisions.com/docs/pgp-module-overview) to be [installed](https://documentation.decisions.com/docs/installing-modules-decisions) before it will be available in the toolbox. --- ## Properties #### Inputs | Property | Description | Data Type | | --- | --- | --- | | Data | The data that will be encrypted. | String | | Public Key String | The Public Key from a source outside of Decisions. | String | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | EncryptString1_Output | The part of the string that was extracted. | String | ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2023-09-07_16h32_30%20-%20encryptstep.png) --- ## Example Inputs and Outputs | Input | Field | Output | | --- | --- | --- | | Null Value | Public Key String | EXCEPTION MESSAGE | #### --- ## Common Errors ### Public Key Cannot be Null The public key field must be filled in for the step to function correctly. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Encrypt String 1[EncryptString] in flow [Misc Step Tests]: Exception invoking method EncryptString on class PGPSteps ---> DecisionsFramework.LoggedException: Exception invoking method EncryptString on class PGPSteps ---> System.ArgumentNullException: Value cannot be null. (Parameter 's' at System.ArgumentNullException.Throw(String paramName at System.Text.Encoding.GetBytes(String s at Decsisions.PGP.Steps.BouncyCastleProcessor.EncryptString(String data, String publicKeyString at Decsisions.PGP.Steps.PGPSteps.EncryptString(String publicKeyString, String data at InvokeStub_PGPSteps.EncryptString(Object, Object, IntPtr* at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data ``` --- --- **Related Information** **Decrypt String [Encrypt File](https://documentation.decisions.com/step-library/docs/encrypt-file)**