The Advanced Encryption Standard or AES is a symmetric block cipher used by the U.S. government to protect classified information and is implemented in software and hardware throughout the world to encrypt sensitive data.
This class makes use of the MQL5 built-in function CryptEncode() to encrypt/decrypt data. Also, it converts the generated data by CryptEncoded() into a HEX string and vice-versa.
It’s possible to work with two key ciphers. You should use the same key for encrypting and decrypting, so both the sender and the receiver must know and use the same secret key. If you don’t know how to build a key, you could get one here.
Example:
//+------------------------------------------------------------------+ //| Script program start function                                    | //+------------------------------------------------------------------+ void OnStart()   {   string txt = "This is a message!";   B.Init("7E846B635877D53A2BD51B320D9453407E8F4C22C104E1E9481783A50FADD162","Password",txt);   Print("Bcrypt key = ",B.Encrypt());   Print("Bcrypt decoded data = ",B.Decrypt(B.Encrypt()));   }
For more information, please take a look at the attached files.