# System.Decrypt(Text) Method
> Version: _Available or changed with runtime version 1.0._
Takes a string as input and returns the decrypted value of the string.
## Syntax
```al
PlainTextString :=   System.Decrypt(EncryptedString: Text)
```
> NOTE
> This method can be invoked without specifying the data type name.
## Parameters
EncryptedString
Type: ../text/text-data-type
The input string that will be decrypted.
## Return Value
PlainTextString
Type: ../text/text-data-type
The output string that is decrypted.
## Remarks
If encryption is not enabled or the encryption key does not exist, the following error will be displayed: An encryption key is required to complete the request. If decryption failed because input data could not be decrypted, the following error will be displayed: Unable to decrypt data. The data was encrypted using a different key.
## Example
This code example checks whether the tenant is configured to allow encryption using the system-encryptionenabled-method method, and then it decrypts an encrypted text string.
This example requires that you create the following text constants: EncryptedText and PlainText.
```al
if not EncryptionEnabled then
        Error('Encryption has not been enabled.');
      PlainText := Decrypt(EncryptedText);

```
## Related information
system-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-decrypt-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-decrypt-method/
