EncryptText - method of the Pm object
Description:
The encryption of the string by the seed.
Syntax:
String EncryptText(String sText, String sSeed)
Parameters:
sText | (String) Text that has to be encrypted |
sSeed | (String) Seed by which the text has to be encrypted (it is necessary for the text decryption). It is recommended to use 5 characters at least. |
---|
Example1:
The encryption of the password and writing it to "ini" file:
JavaScriptVBScriptSelect and copy to clipboard
var sTxt = "Secret text";
var sTextCode = Pm.EncryptText(sTxt, "bflmpsvz");
Pm.IniFileWrite("#cfg:data.ini", "Passwords", "Password1", sTextCode);
Dim sTxt, sTextCode
sTxt = "Secret text"
sTextCode = Pm.EncryptText(sTxt, "bflmpsvz")
Pm.IniFileWrite "#cfg:data.ini", "Passwords", "Password1", sTextCode
Example2:
String encryption and decryption according to specific seed.
JavaScriptVBScriptSelect and copy to clipboard
var sTxt = "Hello";
var sTextDecrypt;
var sTextEncrypt = Pm.EncryptText(sTxt, "bflmpsvz");
Pm.Debug("TextEncrypt=" + sTextEncrypt);
sTextDecrypt = Pm.DecryptText(sTextEncrypt, "bflmpsvz");
Pm.Debug("TextDecrypt=" + sTextDecrypt);
Dim sTxt, sTextDecrypt, sTextEncrypt
sTxt = "Hello"
sTextEncrypt = Pm.EncryptText(sTxt, "bflmpsvz")
Pm.Debug "TextEncrypt=" & sTextEncrypt
sTextDecrypt = Pm.DecryptText(sTextEncrypt, "bflmpsvz")
Pm.Debug "TextDecrypt=" & sTextDecrypt
History:
Pm8.01.06: An error occured if the input text was empty string.