AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de cifrado/compresión
  • Encrypting and decrypting an external file
  • Decrypting a stream in base64binary format
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Advertencia
A partir de la versión 24, Uncrypt se conserva por motivos de compatibilidad. Esta función ha sido reemplazada por Decrypt.
Decrypts a character string that was encrypted by Encrypt.
Note If encryption and decryption are performed on different platforms (e.g. encryption on Android and decryption on Windows), use the functions 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)
Sintaxis
<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:
    cryptAnsiThis constant can only be used in WINDEV Mobile for Windows CE.
    The encryption is identical to the one performed in a WINDEV or WEBDEV application.
    Useful for the applications that encrypt in WINDEV Mobile and that decrypt in WINDEV for example.
    To use this constant, <Format of encrypted string> must be set to True.
    cryptFast
    (Default value)
    Priority was given to the encryption speed (algorithm on 128 bits).
    cryptNoneNo encryption was performed.
    cryptRC516Priority was given to the encryption security (RC5 algorithm on 16 rounds).
    cryptSecurePriority was given to the encryption security (RC5 algorithm on 128 bits).
  • Type of compression:
    compressLZWThe string is compressed before it is encrypted.
    compressNone
    (Default value)
    No compression is performed.
    compressShortStringThe 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.
<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.
encodeBASE64BASE 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 FalseBinary format. The encrypted file may contain non-printable characters.
encodePCS or True
(Default value)
ASCII format. The encrypted file contains printable characters only.
encodeUUEncodeUUEncode format. The encrypted file contains printable characters only.
Observaciones

Encrypting and decrypting an external file

To encrypt/decrypt an external file, use fEncrypt and fDecrypt.

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)
Componente: wd300std.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Exemplo com Fonte
https://repository.windev.com/resource.awp?file_id=281474976711928;exemplo-cryptografia-descryptografia
Boller
15 03 2024
LINK Exemplos
https://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/4235-comandos-criptografia-descriptografia-para-usar-windev-webdev-windev/read.awp
Boller
15 03 2024

Última modificación: 25/03/2025

Señalar un error o enviar una sugerencia | Ayuda local