Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
SacJoshi Valued Contributor.
Valued Contributor.
1016 views

Function: vugen_crypt_encrypt();

Jump to solution

Hi All,

I searched for "Password decryption without using lr_decrypt()", I found the following script:

Action()
{
    char* plaintext = "my secret password";
    char encryptedBuf[100];
    char decryptedBuf[100];
 
    lr_load_dll("C:\\Program Files\\HP\\LoadRunner\\bin\\VuGenCallback.dll");
 
    lr_output_message("plaintext: %s", plaintext);
    vugen_crypt_encrypt(plaintext, -1, encryptedBuf);
    lr_output_message("encrypted: %s", encryptedBuf);
    vugen_crypt_decrypt(encryptedBuf, decryptedBuf);
    lr_output_message("decrypted 1: %s", decryptedBuf);
    lr_output_message("decrypted 2: %s", lr_decrypt(encryptedBuf));
 
    return 0;
}

I tried using this in my script where I have parametrized the password and I am retrieving the password from a file and then using the following function to encrypt the retrieved password.

vugen_crypt_encrypt(password, -1, encryptedBuf);

I did not understand the parameter "-1" passed as an argument to the function. So, I tried replaying the script replacing -1 with different values. The results are as follow:

1) vugen_crypt_encrypt(password, 0, encryptedBuffer);

Action.c(5): Notify: Parameter Substitution: parameter "P_password" = "bean"
Action.c(10): Encrypted Password: 5805bc44e
Action.c(12): Decrypted Password 1:

2) vugen_crypt_encrypt(password, 1, encryptedBuffer);

Action.c(5): Notify: Parameter Substitution: parameter "P_password" = "bean"
Action.c(10): Encrypted Password: 5805bbdc48
Action.c(12): Decrypted Password 1: b

3) vugen_crypt_encrypt(password, 2, encryptedBuffer);

Action.c(5): Notify: Parameter Substitution: parameter "P_password" = "bean"
Action.c(10): Encrypted Password: 5805bc6a0dc5
Action.c(12): Decrypted Password 1: be


4) vugen_crypt_encrypt(password, 3, encryptedBuffer);

Action.c(5): Notify: Parameter Substitution: parameter "P_password" = "bean"
Action.c(10): Encrypted Password: 5805bcf452e2b9
Action.c(12): Decrypted Password 1: bea

5) vugen_crypt_encrypt(password, 4, encryptedBuffer);

Action.c(5): Notify: Parameter Substitution: parameter "P_password" = "bean"
Action.c(10): Encrypted Password: 5805bd2065c80caa
Action.c(12): Decrypted Password 1: bean

6) vugen_crypt_encrypt(password, 5, encryptedBuffer);

Action.c(5): Notify: Parameter Substitution: parameter "P_password" = "bean"
Action.c(10): Encrypted Password: 5805bf999db5ce92ed
Action.c(12): Decrypted Password 1: bean

It seems -1 will work for any encrypted string lenght.

What you all think? I am looking for your valuable comments.

Regards,

Sachin

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Re: Function: vugen_crypt_encrypt();

Jump to solution

Hi Sachin,

The -1 means that the function will process the whole string.  (null-terminated string)

It's not recommended to use it in scripts. The 'VuGenCallback.dll' is even not included in the installation of Load Generator.

Regards,

Wei Sun

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Re: Function: vugen_crypt_encrypt();

Jump to solution

Hi Sachin,

The -1 means that the function will process the whole string.  (null-terminated string)

It's not recommended to use it in scripts. The 'VuGenCallback.dll' is even not included in the installation of Load Generator.

Regards,

Wei Sun

0 Likes
SacJoshi Valued Contributor.
Valued Contributor.

Re: Function: vugen_crypt_encrypt();

Jump to solution

Thanks WeI Sun!

Regards,

Sachin

0 Likes
Highlighted
Contributor.. Dieu-Ai Contributor..
Contributor..

Re: Function: vugen_crypt_encrypt();

Jump to solution

Hi,

In your function reference document mentions that "Vugen uses 32 bit encryption"

What encryption is using in the following methods:

- PasswordEncoder.exe

- PasswordEncoderConsole..exe

_ vugen_scrypt_encrypt()

Does vugen support encryption in the AES 256 standard?  If yes, please show me how.  This is my company requirement to encrypt any password.

Thanks.

 

Dieu-Ai

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.