|
|
|
|
- Encrypting and decrypting an external file
- Decrypting a stream in base64binary format
- Encryption in Android/Java and decryption by a WINDEV application (or conversely)
Decrypt (Function) In french: Décrypte
Warning
From version 24, Uncrypt is kept for backward compatibility. This function has been replaced with Decrypt.
Decrypts a character string that was encrypted by Encrypt. Remark: If the encryption and the decryption are performed on different platforms (encryption in Android and decryption in Windows for example), use EncryptStandard and DecryptStandard. For more details, refer to the "Remarks" paragraph.
// Encrypt a string ResEncrypt = Encrypt("The number of my bank account in Switzerland is 74538290", "Password") ... // Decrypt the string Res = Decrypt(ResEncrypt, "Password")
// Decode the data encoded in base 64 bufDecode is Buffer = Decrypt(bufBase64, "", crypteNone, encodeBASE64)
Syntax
<Result> = Decrypt(<Encrypted string> , <Password> [, <Type of encryption used> [, <Format of encrypted string>]])
<Result>: Character string - Decrypted character string,
- Empty string ("") if an error occurred. To get more details on the error, use ErrorInfo.
<Encrypted string>: Character string Encrypted character string. This character string was encrypted by Encrypt. <Password>: Character string Password used to decrypt the character string. This password must be identical to the password that was used to encrypt the character string. A long password provides better encryption security. <Type of encryption used>: Optional constant (or combination of constants) Specifies the type of encryption and compression performed. This parameter must be identical to the one specified during the encryption.- Type of encryption:
- Type of Compression:
| | compressLZW | The string is compressed before it is encrypted. This constant has no effect. | compressNone (Default value) | No compression is performed. This constant has no effect. | compressShortString | The string is compressed via an algorithm optimized for the short character strings. This compression will be effective only if the cryptNone constant is selected and if <Format of encrypted string> corresponds to the encodeNone constant. This constant has no effect. |
<Format of encrypted string>: Optional Integer constant Indicates the format of the encrypted string. This parameter must be identical to the one specified during the encryption. | | encodeBASE64 | BASE 64 format. The encrypted file contains printable characters only. To decode a buffer in base 64, you also have the ability to use Decode associated with the encodeBASE64 constant. | encodeNone or False | Binary format. The encrypted file may contain non-printable characters. | encodePCS or True (Default value) | ASCII format. The encrypted file contains printable characters only. | encodeUUEncode | UUEncode format. The encrypted file contains printable characters only. |
Remarks Encrypting and decrypting an external file Decrypting a stream in base64binary format To decrypt a string encrypted in base64, you must use: ResultString = Decrypt(EncryptedString, "", cryptNone, encodeBASE64) // or ResultString = Decrypt(EncryptedString, encodeBASE64)
Related Examples:
|
Unit examples (WEBDEV): The encryption functions
[ + ] This example explains how to use the encryption/decryption functions of WEBDEV. This example allows you to: - Encrypt a character string - Decrypt a character string
|
|
Unit examples (WINDEV): The encryption functions
[ + ] Using the encryption/decryption functions of WINDEV. This example is used to: - Encrypt a character string - Decrypt a character string
|
|
Unit examples (WINDEV Mobile): The encryption functions
[ + ] Using the WLanguage encryption and decryption functions. This example is used to: - Encrypt a character string - Decrypt a character string
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|