T
T
trauus2015-10-19 18:24:08
Programming
trauus, 2015-10-19 18:24:08

How to save the secret key?

You need to store a string with a secret key in a C# application. What other ways are there besides hardwiring the key into the code and then using an obfuscator?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Zolotov, 2015-10-19
@SZolotov

If you are working with System.Security.Cryptography, read about the CspParameters class and the KeyContainerName property. Everything has been thought of before us.

D
Dasha Tsiklauri, 2015-10-19
@dasha_programmist

split the key into a char array, initialize the array elements in different places of the code (but it is important that the compiler does not optimize this) for search complexity,
and use ProtectedMemory
https://msdn.microsoft.com/en-us/library/system.se .. Set
dependent parts in the OS registry, but you need to be sure of the existence of branches, the names of branches are also implicitly stored in the code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question