ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Encryption/compression functions
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
Generates an RSA private/public key pair.
Example
bufToEncrypt is Buffer = "My message to encrypt"
 
bufPrivateKey is Buffer
bufPublicKey is Buffer
 
// Generate private, public keys
(bufPrivateKey,bufPublicKey) = EncryptGenerateRSAKey()
 
// Save in files
fSaveText("FilePrivateKey.pem", bufPrivateKey)
fSaveText("FilePublicKey.pem", bufPublicKey)
 
// Encryption
bufEncryptedMessage is Buffer = EncryptAsymmetric(butToEncrypt, ...
"FilePublicKey.pem", "", cryptPaddingOAEP)
 
// Decryption
bufDecryptedMessage is Buffer = DecryptAsymmetric(bufEncryptedMessage, ...
"FilePrivateKey.pem", "", cryptPaddingOAEP)
Syntax
(<Private key>, <Public key>) = EncryptGenerateRSAKey([<Size>])
<Private key>: Buffer
PEM private key.
<Public key>: Buffer
PEM public key.
<Size>: Optional integer
Number of bits in the key. This parameters corresponds to 4096. by default.
Related Examples:
Asymmetric encryption Unit examples (WINDEV): Asymmetric encryption
[ + ] Using the asymmetric encryption functions (EncryptAsymmetric, DecryptAsymmetric)
Business / UI classification: Business Logic
Component: wd300com.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help