Products Downloads


French version


 

This function encrypts a password or converts an encrypted password. It is used for program-based generation of the Runtime's configuration files (MWCLIENT.INI, MWSERVER.INI. etc.).

The corresponding decryption function is not provided.


The initial password can be provided unencrypted, encrypted with the historic Adelia algorithm or AES encrypted (in this case, the string must start with {AES}). The output password can be encrypted in Adelia, in AES or in the form of a HASH SHA256.


This function does not support the RSA algorithm. To encrypt a password in RSA, if you have the server public key, use the ENCRYPT instruction and add the prefix {RSA}. However, this function does not decrypt or weaken the encryption (conversion of an AES-encrypted password into Adelia format).



Context

  • Windows client

  • Windows server

  • Adelia Web Client

  • Java client

  • Java server

  • Adelia Cloud client

  • Event Adelia client


Parameters

ALPHA(n)

User

User name.

ALPHA(n)

Password

Password to encrypt or convert.

BOOL Encrypted Specifies if the password is initially encrypted.

ALPHA(n)

EncryptedPassword

String containing the encrypted value of the password.

The length of the variable (n) must obey the following rule:

n >= ((PasswordLgth - 1) / 8 + 1) * 16 ) + 2

where:

PasswordLgth is the length of the password to encrypt.

NUM_BIN_4

EncryptedPasswordLength

Length of the EncryptedPassword string definition.

NUM_BIN_4 Algorithm

Encryption algorithm to use:

1: Adelia

2: AES

3: SHA256

NUM_BIN_4

ReturnCode

Operation return code:

0 : operation completed successfully.

1: invalid parameter (blank user or password, encryption algorithm not supported).

2: invalid input password (RSA or SHA256 encryption).

3: an error occurred while decrypting the password.

4: an error occurred while decrypting the password (system error, EncryptedPassword definition too short).



For example

ALPHA(128)   User

ALPHA(128)   DecryptedPassword

ALPHA(260)   EncryptedPassword

NUM_BIN_4   ReturnCode


User   = 'HARDISPS'

DecryptedPassword = 'HARDISPS'


* Direct AES encryption

CALL_DLL 'VATOOLBX.DLL' 'VaToolBxConvertAdeliaPassword' User DecryptedPassword *FALSE EncryptedPassword 260 2 ReturnCode

*  EncryptedPassword now contains the '{AES}rdawhC8z9dHQw1LkHxpiEQ==' value


List of VaToolBx DLL functions by topic



↑ Top of page