--- title: "Decrypt File" slug: "decrypt-file" updated: 2024-10-07T19:17:52Z published: 2024-10-07T19:17:52Z canonical: "documentation.decisions.com/decrypt-file" --- > ## 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. # Decrypt File | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 8.1.0 | | **Location** | PGP Steps | --- The **Decrypt File** step allows a user to decrypt a PGP encrypted file. ### Prerequisites This step requires the [PGP module](https://documentation.decisions.com/docs/pgp-module-overview#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 | | --- | --- | --- | | File | The desired PGP encrypted file | FileData | | Private Key | Generated PGP private key file used for encrypting or decrypting | FileData | | Private Key Password | Password for the specified Private Key | String | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | Output | Outputs the decrypted file | FileData | --- ## Example Inputs and Outputs | File | Private Key | Private Key Password | Output | | --- | --- | --- | --- | | file.txt | 3992-sec.asc | catch | Id: "ac665621-ad64-4b40-b836-dd73c82b98d7",FileName: "file.txt",Length: 7,FileType: ".txt" | | Null | private-sec.asc | newman | EXCEPTION MESSAGE | | Showdetails.pdf | Null | string | EXCEPTION MESSAGE | | flyer.docx | private-sec.asc | Empty | EXCEPTION MESSAGE | #### ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1675288674019.png) --- ## Common Errors ### Object reference not set to an instance of an object If the File input or the Password for the provided Private Key is null or empty, the step will cause an error. To correct this, ensure that an encrypted PGP file is uploaded or mapped to the File input and that the password entered for the Private Key is correct. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Decrypt File 1[DecryptFile] in flow [Flow 2]: Exception invoking method DecryptFile on class PGPSteps ---> DecisionsFramework.LoggedException: Exception invoking method DecryptFile on class PGPSteps ---> System.NullReferenceException: Object reference not set to an instance of an object. at Decsisions.PGP.Steps.PGPSteps.DecryptFile(Byte[] privateKey, String privateKeyPassword, FileData file) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` --- ### Value cannot be null If the Private Key is null or empty, the step will cause an error. To correct this, ensure that the correct Private Key file is uploaded or mapped. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Decrypt File 1[DecryptFile] in flow [Flow 2]: Value cannot be null. (Parameter 'path') ---> System.ArgumentNullException: Value cannot be null. (Parameter 'path' at DecisionsFramework.Utilities.Data.DataUtilities.GetValue(IDictionary`2 data, String path, Boolean throwError, Boolean returnReferences at DecisionsFramework.Design.Flow.Mapping.InputImpl.SelectValueInputMapping.GetInputValue(IDataConsumer consumer, FlowStateData currentData, DecisionsType expectedType, Boolean expectingArray, String valueName, Object parentObject, Boolean canBeNull at DecisionsFramework.Design.Flow.FlowStep.BuildMappingData(FlowStateData data at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` --- Related Information Documentation: [PGP Module](https://documentation.decisions.com/docs/pgp-module-overview#overview) Forum Posts: [Error While Encrypting A File Using PGP](https://community.decisions.com/discussion/1814/error-while-encrypting-a-file-using-pgp) [PGP Issues With Decrypting Using Private Key](https://community.decisions.com/discussion/2522/pgp-issues-with-decrypting-using-private-key) ## Related - [Touch File](/touch-file.md) - [Publish File To Server](/publish-file-to-server.md) - [Download File to Path](/download-file-to-path.md) - [Encrypt File](/encrypt-file.md)