// Define your encryption key here. Must be 7 characters for DES/ECB encryption // IT MUST BE THE SAME PASSWORD AS DEFINE IN THE "Password_Check()" function! // Make your password difficult to figure out. You last name is not a good idea! // Something like "wLdU&$z" would be good. For now, we'll use a simple one... MasterKey = "notdemo";
// Convert MasterKey to character array StringToCharArray(MasterKey, key);
// Encrypt the client using DES key StringToCharArray(client, src); CryptEncode(CRYPT_DES, src, key, dst);
// Clear key and encode to BASE64 ArrayInitialize(key, 0x00); CryptEncode(CRYPT_BASE64, dst, key, src);
// Compare password and return result return(CharArrayToString(src) == Password);
I have not been able to duplicate the error since my XP machine is now dead :(
Please run the revised code on both your machines and send me the screen captures.
Thank you.
I have tried several times to make this work and I just don't know how to add it to my EA. I get a lot of errors I don't understand. Do I put it in the source code body? Do I make up my own password? Can you help me understand how to do this? I am very new to this. Thank you.
I encoded the Password Checker and already set the Master Key or Password but when I input the Indicator File to the chart, it bypass the password, even I type a wrong password, still the indicator will work normal. How to fix this, I don't receive any errors or warning about password incorrect.
Hey, thank you so much for the coding and explanation on everything to password protect my EA :)
I just have a couple questions for anyone who can answer...
1. When I 'compile' my source code after going through the 'password_check' process of putting in all the codes you have given, I always get
some errors. I get an error that says ''init - function already defined and has body"'.. How do I fix that?
2. Secondly, how exactly does that "password_generate" part work? Where do I place that code (separate from the other coding?)? Also, how
exactly do I run it? I guess I'm slightly confused.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hidayat,
I have not been able to duplicate the error since my XP machine is now dead :(
Please run the revised code on both your machines and send me the screen captures.
Thank you.
Hello Mr.Claude,
I have tried this indicator with changes in init(), but going on getting the error, "ExpertRemove Reason No.5".
Please help Sir.
Hello Mr.Claude,
I have tried this indicator with changes in init(), but going on getting the error, "ExpertRemove Reason No.5".
Please help Sir.
I'm getting the following errors. I am not sure why as I followed Claude's instruction as well as I could.
'Password_Check' - function not defined
and also
'Password_Check' - function can be declared only in the global scope
I'm not a coder so not sure how to remedy the situation.
Thanks in advance
There is a mistake in the last box
correct is:
//+------------------------------------------------------------------+
//| Validate client's password
//+------------------------------------------------------------------+
bool Password_Check(string client)
{
string MasterKey;
uchar dst[], src[], key[];
// Define your encryption key here. Must be 7 characters for DES/ECB encryption
// IT MUST BE THE SAME PASSWORD AS DEFINE IN THE "Password_Check()" function!
// Make your password difficult to figure out. You last name is not a good idea!
// Something like "wLdU&$z" would be good. For now, we'll use a simple one...
MasterKey = "notdemo";
// Convert MasterKey to character array
StringToCharArray(MasterKey, key);
// Encrypt the client using DES key
StringToCharArray(client, src);
CryptEncode(CRYPT_DES, src, key, dst);
// Clear key and encode to BASE64
ArrayInitialize(key, 0x00);
CryptEncode(CRYPT_BASE64, dst, key, src);
// Compare password and return result
return(CharArrayToString(src) == Password);
}
Hidayat,
I have not been able to duplicate the error since my XP machine is now dead :(
Please run the revised code on both your machines and send me the screen captures.
Thank you.
I have tried several times to make this work and I just don't know how to add it to my EA. I get a lot of errors I don't understand. Do I put it in the source code body? Do I make up my own password? Can you help me understand how to do this? I am very new to this. Thank you.
Hey, thank you so much for the coding and explanation on everything to password protect my EA :)
I just have a couple questions for anyone who can answer...
1. When I 'compile' my source code after going through the 'password_check' process of putting in all the codes you have given, I always get some errors. I get an error that says ''init - function already defined and has body"'.. How do I fix that?
2. Secondly, how exactly does that "password_generate" part work? Where do I place that code (separate from the other coding?)? Also, how exactly do I run it? I guess I'm slightly confused.
Any and all help is greatly appreciated. Thanks,
-Tyler