# The cryptographic operation has failed! error after upgrade to R1 2020 or later

## Environment

<table>
	<tbody>
		<tr>
			<td>Product Version</td>
			<td>2020.1.114</td>
		</tr>
		<tr>
			<td>Product</td>
			<td>RadAsyncUpload for ASP.NET AJAX</td>
		</tr>
	</tbody>
</table>

## Description

In R1 2020, the custom metadata classes(upload configurations) whitelisting is enabled by default - [Whitelist custom metadata types](https://www.telerik.com/products/aspnet-ajax/documentation/controls/asyncupload/security/security#allowedcustommetadatatypes). If your application uses such configurations, you will need to add them to the `Telerik.Upload.AllowedCustomMetaDataTypes` key in the web.config.

You need to add the fully qualified name of the class, otherwise you will get a `The cryptographic operation has failed!` error when attempting an upload.

```web.config
<appSettings>
    <add key="Telerik.Upload.AllowedCustomMetaDataTypes" value="SomeNameSpace.SampleAsyncUploadConfiguration;SomeOtherNameSpace.OtherAsyncUploadConfiguration" />
</appSettings>
```

### Other reasons for the error

If adding the `AllowedCustomMetaDataTypes` key or not using custom configuration files do not fix the error, please ensure you have set the necessary encryption keys:

* [ConfigurationEncryptionKey](https://www.telerik.com/products/aspnet-ajax/documentation/controls/asyncupload/security/security#configurationencryptionkey)
* [ConfigurationHashKey](https://www.telerik.com/products/aspnet-ajax/documentation/controls/asyncupload/security/security#configurationhashkey)
* [Telerik.Web.UI.DialogParametersEncryptionKey](https://www.telerik.com/products/aspnet-ajax/documentation/controls/editor/functionality/dialogs/security#dialogparametersencryptionkey), if using RadEditor dialogs

## Solution

The solution is to add all the custom configuration classes to the `Telerik.Upload.AllowedCustomMetaDataTypes` key separated by a semicolon `;`. To find out the fully qualified names, you can use the following approach that lists the items in a label.

```ASP.NET
<asp:Label Text="Label1" ID="Label1" runat="server" />
```

```C#
protected void Page_Load(object sender, EventArgs e)
{
    Label1.Text = typeof(MySampleAsyncUploadConfiguration).AssemblyQualifiedName.Split(',')[0];
}
```

For convenience, you can download the `AsyncUploadGetCustomMetaDataTypes` sample project implementing the suggested approach from the link below. To make it runnable, place the `Telerik.Web.UI.dll` assembly in the bin folder of the project.

* [AsyncUploadGetCustomMetaDataTypes.zip](https://www.telerik.com/products/aspnet-ajax/documentation/assets/42a347c40c9e235e3f6f5d3c9e91c534/asyncuploadgetcustommetadatatypes.zip).

In the project you will find two pages with two different custom handlers. As you can see, the custom handler that does not have custom configuration, does not need to have anything added to the `Telerik.Upload.AllowedCustomMetaDataTypes` key.

## See Also

* [AsyncUpload Security](https://www.telerik.com/products/aspnet-ajax/documentation/controls/asyncupload/security/security) article
* [AsyncUpload - Custom Http Handler](https://demos.telerik.com/aspnet-ajax/asyncupload/examples/imageuploader/defaultcs.aspx) online demo
* [How to Create a Custom Handler for RadAsyncUpload](https://www.telerik.com/products/aspnet-ajax/documentation/controls/asyncupload/how-to/how-to-extend-the-radasyncupload-handler) article
* [RadEditor Security](https://www.telerik.com/products/aspnet-ajax/documentation/controls/editor/functionality/dialogs/security) article
