Hii, I had a requirement to encode a string provided in an unreadable format, and also perform decoding after performing certain actions. I tried the encoding "Base64". But this is not a safe way. I need other solutions. Give some help regarding the above context.
You can use a symmetric encryption algorithm. Here is an example . Both parties (encryption / decryption) must share a common secret key for this.
. #. , RijndaelManaged. . SQ
See the followinghttp://www.codeproject.com/KB/cs/Cryptography.aspxhttp://www.codeproject.com/KB/security/DotNetCrypto.aspx
Here is an example of using RSA. Replace your_rsa_key with the RSA key.
System.Security.Cryptography.RSACryptoServiceProvider Provider = new System.Security.Cryptography.RSACryptoServiceProvider(); Provider.ImportParameters(your_rsa_key); byte[] encrypted = Provider.Encrypt(System.Text.Encoding.UTF8.GetBytes("Hello World!"), true); string decrypted = System.Text.Encoding.UTF8.GetString(Provider.Decrypt(encrypted, true));
Namespace System.Security.Cryptographycan help you. But when choosing an encryption algorithm, consider the size of the data you are trying to encrypt and the level of security that you want to achieve.
System.Security.Cryptography
Source: https://habr.com/ru/post/1742250/More articles:Should groupId be unique in a multi-module project? - maven-2Typedef C ++, could not solve its meaning - c ++Python: combining log and wx so that the log flow is redirected to stdout / stderr frame - pythonWCF - passing the current pointer in the header - headerLINQ to SQL for tables between databases. Or View? - sqlAdding firewall exceptions to other firewall products than the Windows firewall - for example, Norman, Norton, etc. - installerIdentify machines behind a router uniquely based on ipaddress - networkingFirefox 3.5.9 rejects input: text when all other browsers handle it perfectly - htmlWhat is the maximum number of controls that a VBA form can store? - vbaRESTful API: how to handle translated text fields in views? - restAll Articles