.Net Encryption

Мои два цента,

Учитывая возрастной диапазон = [18, 100+], две цифры года = 90, я могу сделать

current year - twoDigitsYear = 2018 - 90 = 1928, я получил 19, 28

, следовательно, 19 - это первые две цифры года рождения, а 28 - это возраст, который составляет
год = 1990, возраст = 28

Но это не сработает, когда возраст 0 и 100 включены в диапазон, то же самое с некоторыми другими ответами здесь.

20
задан ROMANIA_engineer 3 November 2017 в 19:58
поделиться

3 ответа

  1. Yes. Secrets encrypted with the machine key can be decrypted by any process with access to the machine key. Secrets encrypted with the user key can be decrypted by any process started by the same user.
  2. This is not possible. All contrary claims are snake oil. You application needs a secret to decrypt something. There are no known schemes to hide a secret inside an application. There are various obfuscation schemes, but nothing bulletproof. The best you can do is to raise the bar.
  3. No. Either the application has the secret key to decrypt something, in which case you go back to point 2, or your application has the public key, in which case anyone can decrypt the same secret, so you basically do a validation of the configuration (was not tampered with), but the configuration is not secret.
  4. You cannot deploy embedded secrets in an application securely. Is just a matter of how high is the price, if your protected asset (the secret) is worth it, then a hacker will get it.

The encryption infrastructure is designed to protect the secrets of the current user from other users. It is not designed to protect the secrets of an application from the user using it. What you ask for is not encryption, is DRM, and you need to look into the DRM infrastructure for answers. I'm not aware of a managed library around the DRM API.

13
ответ дан 30 November 2019 в 01:16
поделиться

Good question actually,

You can not be sure noone will decrypt your connection string (or password). Of course you can encrypt it, but people will be able to decompile your application and see what encryption algrorithm you use and what key you use to decrypt your connection string/password. Maybe it's more like extreme scenario but it is possible (I was an evil cracker in student years :) ). So if you are afraid of such a scenario you have to protect your application, make it harder to disassemble. It's a theme for another discussion, but for example you can use Dotfuscator or other good obfuscator - it will make it harder for a cracker to understand what is going on inside your application.
So, one possible solution can be "encrypt connection string + use obfuscator", but, as I said, it will not give you 100% protection.

3
ответ дан 30 November 2019 в 01:16
поделиться

Хранение секретов с симметричным шифрованием всегда проблематично, если вы не хотите запрашивать пароль или использовать другое техническое решение для расшифровки секрета (например, специальное оборудование). Когда вам нужно сохранить полный ключ где-нибудь в системе, у других людей будет возможность получить его.

Я определенно попробую использовать механизм операционной системы. Когда вы работаете в чистой среде Windows с MS-SQL, вы должны использовать встроенную безопасность вместо пользователя / пароля. Другие базы данных также могут иметь аналогичные возможности.
Другой (более слабый) вариант - защитить открытый текстовый файл настройками безопасности операционной системы - только пользователь получает доступ к файлу. Однако вы и ваши пользователи должны доверять администраторам. В этом случае следует дополнительно использовать симметричное шифрование. Но посмотрите мои первые аргументы - это будет небезопасно.

2
ответ дан 30 November 2019 в 01:16
поделиться
Другие вопросы по тегам:

Похожие вопросы: