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
  • Asymmetric encryption of an envelope
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Warning
From version 28, EncryptAsymmetricEnvelopped is kept for backward compatibility. This function has been replaced with EncryptAsymmetricEnveloped.
Performs an asymmetric encryption of an envelope.
Example
// Cryptage d'une chaîne de caractères
//---------------------------------------
bufACrypter is Buffer = "Message à crypter"
bufMessageCrypté is Buffer
sFichierCléPublique is string = fExeDir() + "\ClePublique.pem"
sMotDePasseCléPublique is string = "xxx"

bufMessageCrypté = EncryptAsymmetricEnveloped(bufACrypter, sFichierCléPublique, sMotDePasseCléPublique)

// Décryptage  
// -------------
bufMessageCrypté is Buffer
bufMessageDécrypté is Buffer
sFichierCléPrivée is string = fExeDir() + "\ClePrivee.pem"
sMotDePasseCléPrivée is string = "xxx"

bufMessageDécrypté = DecryptAsymmetricEnveloped(bufMessageCrypté, sFichierCléPrivée, sMotDePasseCléPrivée)
bufACrypter is Buffer = "Message à crypter"
bufMessageCrypté is Buffer
bufCléPublique is Buffer
bufCléPrivée is Buffer
(bufCléPrivée, bufCléPublique) = EncryptGenerateRSAKey(1024)
// Cryptage d'une chaîne de caractères
//---------------------------------------
bufMessageCrypté = EncryptAsymmetricEnveloped(bufACrypter, bufCléPublique)

// Décryptage  
// -------------
bufMessageCrypté is Buffer
bufMessageDécrypté is Buffer

bufMessageDécrypté = DecryptAsymmetricEnveloped(bufMessageCrypté, bufCléPrivée)
Syntax
<Result> = EncryptAsymmetricEnveloped(<Content to encrypt> , <Public key file> [, <Password>])
<Result>: Buffer
All the information necessary for decryption (algorithms used, encrypted key, initialization vector and encrypted buffer).
<Content to encrypt>: Buffer
Buffer to encrypt.
<Public key file>: Character string or Buffer
  • Name and path of the file corresponding to the public key that will be used to encrypt. pem, der and p12 key formats are supported.
  • Buffer containing the public key that will be used for the encryption.
<Password>: Optional character string
Key file password (if required).
Remarks

Asymmetric encryption of an envelope

EncryptAsymmetricEnveloped generates a random encryption key that will be used to encrypt <Content to encrypt> with a symmetric algorithm.
The key is encrypted with the public key of <Public key file>.
<Result> contains a buffer that concatenates all the necessary information for the decryption (algorithms used, encrypted key, initialization buffer and encrypted buffer).
Remarks:
  • The private key is encrypted using OAEP padding.
  • The message is encrypted using AES 256 in CBC with PKCS padding.
Component: wd290com.dll
Versión mínima requerida
  • Versión 24
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/11/2023

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