Was this helpful?
Here is a code snippet to help you encrypt and decrypt a string in C#.
The key is hardcoded, but in your own project you may want to read it from a secure store, or perhaps a config file or environment variable.
Notice that the key is being hashed for an extra layer of security.
And here is the output:
|posted||Apr 03, 2016|
|active||Apr 04, 2016|
|•||C#: best practice of when to use a var vs the actual type?|
|•||Is there a difference between String and string in C#?|
|•||Dynamically combining multiple OrderBy clauses in LINQ|
|•||How do I get the response from an asynchronous Ajax call?|
|•||How can I prevent SQL-injection in ADO.NET?|
|•||When to use 'ref' and 'out' keywords - specifically with strings?|
|•||Why does the C# Random number generator just create a single number?|
|•||C# Singleton design pattern example|
|•||Can I deserialize JSON into a dynamic object in C#?|