- Key Encryption At RestВ¶
- Windows DPAPIВ¶
- X.509 certificateВ¶
- Windows DPAPI-NGВ¶
- Certificate-based encryption with Windows DPAPI-NGВ¶
- Custom key encryptionВ¶
- Key Encryption At RestВ¶
- Windows DPAPIВ¶
- X.509 certificateВ¶
- Windows DPAPI-NGВ¶
- Certificate-based encryption with Windows DPAPI-NGВ¶
- Custom key encryptionВ¶
- Ошибка при миграциях
- Шифрование неактивных ключей в Windows и Azure с помощью ASP.NET Core Key encryption at rest in Windows and Azure using ASP.NET Core
- Azure Key Vault Azure Key Vault
- Windows DPAPI Windows DPAPI
- Сертификат X.509 X.509 certificate
- Windows DPAPI — NG Windows DPAPI-NG
- Шифрование на основе сертификата с помощью Windows DPAPI-NG Certificate-based encryption with Windows DPAPI-NG
- Шифрование с пользовательским ключом Custom key encryption
Key Encryption At RestВ¶
By default the data protection system employs a heuristic to determine how cryptographic key material should be encrypted at rest. The developer can override the heuristic and manually specify how keys should be encrypted at rest.
Note: If you specify an explicit key encryption at rest mechanism, the data protection system will deregister the default key storage mechanism that the heuristic provided. You must specify an explicit key storage mechanism , otherwise the data protection system will fail to start.
The data protection system ships with three in-box key encryption mechanisms.
Windows DPAPIВ¶
This mechanism is available only on Windows.
When Windows DPAPI is used, key material will be encrypted via CryptProtectData before being persisted to storage. DPAPI is an appropriate encryption mechanism for data that will never be read outside of the current machine (though it is possible to back these keys up to Active Directory; see DPAPI and Roaming Profiles). For example to configure DPAPI key-at-rest encryption.
If ProtectKeysWithDpapi is called with no parameters, only the current Windows user account can decipher the persisted key material. You can optionally specify that any user account on the machine (not just the current user account) should be able to decipher the key material, as shown in the below example.
X.509 certificateВ¶
This mechanism is not yet available on `.NET Core`.
If your application is spread across multiple machines, it may be convenient to distribute a shared X.509 certificate across the machines and to configure applications to use this certificate for encryption of keys at rest. See below for an example.
Because this mechanism uses X509Certificate2 and EncryptedXml under the covers, this feature is currently only available on Desktop CLR. Additionally, due to .NET Framework limitations only certificates with CAPI private keys are supported. See Certificate-based encryption with Windows DPAPI-NG below for possible workarounds to these limitations.
Windows DPAPI-NGВ¶
This mechanism is available only on Windows 8 / Windows Server 2012 and later.
Beginning with Windows 8, the operating system supports DPAPI-NG (also called CNG DPAPI). Microsoft lays out its usage scenario as follows.
Cloud computing, however, often requires that content encrypted on one computer be decrypted on another. Therefore, beginning with Windows 8, Microsoft extended the idea of using a relatively straightforward API to encompass cloud scenarios. This new API, called DPAPI-NG, enables you to securely share secrets (keys, passwords, key material) and messages by protecting them to a set of principals that can be used to unprotect them on different computers after proper authentication and authorization.
The principal is encoded as a protection descriptor rule. Consider the below example, which encrypts key material such that only the domain-joined user with the specified SID can decrypt the key material.
There is also a parameterless overload of ProtectKeysWithDpapiNG. This is a convenience method for specifying the rule “SID=mine”, where mine is the SID of the current Windows user account.
In this scenario, the AD domain controller is responsible for distributing the encryption keys used by the DPAPI-NG operations. The target user will be able to decipher the encrypted payload from any domain-joined machine (provided that the process is running under their identity).
Certificate-based encryption with Windows DPAPI-NGВ¶
If you’re running on Windows 8.1 / Windows Server 2012 R2 or later, you can use Windows DPAPI-NG to perform certificate-based encryption, even if the application is running on `.NET Core`_ . To take advantage of this, use the rule descriptor string “CERTIFICATE=HashId:thumbprint”, where thumbprint is the hex-encoded SHA1 thumbprint of the certificate to use. See below for an example.
Any application which is pointed at this repository must be running on Windows 8.1 / Windows Server 2012 R2 or later to be able to decipher this key.
Custom key encryptionВ¶
If the in-box mechanisms are not appropriate, the developer can specify their own key encryption mechanism by providing a custom IXmlEncryptor.
Key Encryption At RestВ¶
By default the data protection system employs a heuristic to determine how cryptographic key material should be encrypted at rest. The developer can override the heuristic and manually specify how keys should be encrypted at rest.
Note: If you specify an explicit key encryption at rest mechanism, the data protection system will deregister the default key storage mechanism that the heuristic provided. You must specify an explicit key storage mechanism , otherwise the data protection system will fail to start.
The data protection system ships with three in-box key encryption mechanisms.
Windows DPAPIВ¶
This mechanism is available only on Windows.
When Windows DPAPI is used, key material will be encrypted via CryptProtectData before being persisted to storage. DPAPI is an appropriate encryption mechanism for data that will never be read outside of the current machine (though it is possible to back these keys up to Active Directory; see DPAPI and Roaming Profiles). For example to configure DPAPI key-at-rest encryption.
If ProtectKeysWithDpapi is called with no parameters, only the current Windows user account can decipher the persisted key material. You can optionally specify that any user account on the machine (not just the current user account) should be able to decipher the key material, as shown in the below example.
X.509 certificateВ¶
This mechanism is not yet available on Core CLR.
If your application is spread across multiple machines, it may be convenient to distribute a shared X.509 certificate across the machines and to configure applications to use this certificate for encryption of keys at rest. See below for an example.
Because this mechanism uses X509Certificate2 and EncryptedXml under the covers, this feature is currently only available on Desktop CLR. Additionally, due to .NET Framework limitations only certificates with CAPI private keys are supported. See Certificate-based encryption with Windows DPAPI-NG below for possible workarounds to these limitations.
Windows DPAPI-NGВ¶
This mechanism is available only on Windows 8 / Windows Server 2012 and later.
Beginning with Windows 8, the operating system supports DPAPI-NG (also called CNG DPAPI). Microsoft lays out its usage scenario as follows.
Cloud computing, however, often requires that content encrypted on one computer be decrypted on another. Therefore, beginning with Windows 8, Microsoft extended the idea of using a relatively straightforward API to encompass cloud scenarios. This new API, called DPAPI-NG, enables you to securely share secrets (keys, passwords, key material) and messages by protecting them to a set of principals that can be used to unprotect them on different computers after proper authentication and authorization.
The principal is encoded as a protection descriptor rule. Consider the below example, which encrypts key material such that only the domain-joined user with the specified SID can decrypt the key material.
There is also a parameterless overload of ProtectKeysWithDpapiNG. This is a convenience method for specifying the rule “SID=mine”, where mine is the SID of the current Windows user account.
In this scenario, the AD domain controller is responsible for distributing the encryption keys used by the DPAPI-NG operations. The target user will be able to decipher the encrypted payload from any domain-joined machine (provided that the process is running under their identity).
Certificate-based encryption with Windows DPAPI-NGВ¶
If you’re running on Windows 8.1 / Windows Server 2012 R2 or later, you can use Windows DPAPI-NG to perform certificate-based encryption, even if the application is running on Core CLR. To take advantage of this, use the rule descriptor string “CERTIFICATE=HashId:thumbprint”, where thumbprint is the hex-encoded SHA1 thumbprint of the certificate to use. See below for an example.
Any application which is pointed at this repository must be running on Windows 8.1 / Windows Server 2012 R2 or later to be able to decipher this key.
Custom key encryptionВ¶
If the in-box mechanisms are not appropriate, the developer can specify their own key encryption mechanism by providing a custom IXmlEncryptor.
Ошибка при миграциях
Всем привет.
Изучаю .Net Core, при выполнении действий из книги Фримана, Add-Migration Initial получаю след ошибку:
по ссылке, https://go.microsoft.com/fwlink/?linkid=851728, что указана в ошибке код правил, ничего не меняется
ASP.NET Core. Повалил базу данных на миграциях. Как создать новую?
Собственно, вот и попал. Проводил миграции по сущностям, в один прекрасный момент что-то пошло не.
Ошибка при чтении изменений при обмене РИБ: Ошибка при вызове метода контекста (ПрочитатьИзменения): Ошибка записи!
Доброго всем времени суток! подскажи пожалуйста как исправить ошибку: Ошибка при чтении изменений.
Ошибка при передаче строк в функцию, ошибка при формировании дерева
Курсовой проект, в основе база данных, данные записываются в двоичное дерево. Есть 2 проблемы: 1).
Cannot resolve scoped service ‘Market.Models.AppDbContext’ это говорит а том что он не может разрезолвить тип
Add an implementation of ‘IDesignTimeDbContextFactory’ нужно для миграции
Ниже пример рабочий.
Вложения
ConsoleApp601.zip (1.8 Кб, 8 просмотров) |
Тематические курсы и обучение профессиям онлайн Профессия С#-разработчик (Skillbox) Архитектор ПО (Skillbox) Профессия Тестировщик (Skillbox) |
Заказываю контрольные, курсовые, дипломные и любые другие студенческие работы здесь или здесь.
Ошибка HTTP 500 — внутреняя ошибка сервера при отправке почты.
Я пытаюсь отправить почту и присоединяю к ней письма Вот часть страницы Dim myMail Set myMail =.
Ошибка: При декодировании JSON возникла ошибка: Illegal Token
Добрый день. Сегодня решил обновить WordPress до версии 5.2, но перед этим сделал резервную копию.
ошибка адобе реадер при установке ошибка 1395 вроде
черт знает что никак не пойму с чего он выкидывает такую ошибку.
Ошибка при открытии файла — Ошибка в части содержимого в книге
Добрый день! Открываю файл. Создаю макросом сводную таблицу, сохраняю файл. Затем при попытке.
Шифрование неактивных ключей в Windows и Azure с помощью ASP.NET Core Key encryption at rest in Windows and Azure using ASP.NET Core
Система защиты данных по умолчанию использует механизм обнаружения, чтобы определить способ шифрования неактивных криптографических ключей. The data protection system employs a discovery mechanism by default to determine how cryptographic keys should be encrypted at rest. Разработчик может переопределить механизм обнаружения и вручную указать способ шифрования неактивных ключей. The developer can override the discovery mechanism and manually specify how keys should be encrypted at rest.
Если указать явное Расположение сохраняемости ключа, система защиты данных отменяет регистрацию шифрования ключа по умолчанию в механизме RESTful. If you specify an explicit key persistence location, the data protection system deregisters the default key encryption at rest mechanism. Следовательно, ключи больше не шифруются. Consequently, keys are no longer encrypted at rest. Рекомендуется указать явный механизм шифрования ключей для рабочих развертываний. We recommend that you specify an explicit key encryption mechanism for production deployments. В этом разделе описаны варианты механизма шифрования с неактивных шифрованием. The encryption-at-rest mechanism options are described in this topic.
Azure Key Vault Azure Key Vault
Чтобы сохранить ключи в Azure Key Vault, настройте систему с помощью протекткэйсвисазурекэйваулт в Startup классе: To store keys in Azure Key Vault, configure the system with ProtectKeysWithAzureKeyVault in the Startup class:
Windows DPAPI Windows DPAPI
Применяется только к развертываниям Windows. Only applies to Windows deployments.
При использовании Windows DPAPI материал ключа шифруется с помощью CryptProtectData перед сохранением в хранилище. When Windows DPAPI is used, key material is encrypted with CryptProtectData before being persisted to storage. DPAPI — это подходящий механизм шифрования для данных, которые никогда не читаются за пределами текущего компьютера (хотя эти ключи можно переключать на Active Directory; см. раздел DPAPI и перемещаемые профили). DPAPI is an appropriate encryption mechanism for data that’s never read outside of the current machine (though it’s possible to back these keys up to Active Directory; see DPAPI and Roaming Profiles). Чтобы настроить шифрование неактивных ключей DPAPI, вызовите один из методов расширения протекткэйсвисдпапи : To configure DPAPI key-at-rest encryption, call one of the ProtectKeysWithDpapi extension methods:
Если ProtectKeysWithDpapi вызывается без параметров, только текущая учетная запись пользователя Windows может расшифровать сохраненный кольцо ключа. If ProtectKeysWithDpapi is called with no parameters, only the current Windows user account can decipher the persisted key ring. При необходимости можно указать, что любая учетная запись пользователя на компьютере (а не только текущая учетная запись пользователя) сможет расшифровать ключевое кольцо: You can optionally specify that any user account on the machine (not just the current user account) be able to decipher the key ring:
Сертификат X.509 X.509 certificate
Если приложение распределено между несколькими компьютерами, может быть удобно распространять общий сертификат X. 509 на компьютерах и настраивать размещенные приложения для использования сертификата для шифрования неактивных ключей: If the app is spread across multiple machines, it may be convenient to distribute a shared X.509 certificate across the machines and configure the hosted apps to use the certificate for encryption of keys at rest:
Из-за ограничений .NET Framework поддерживаются только сертификаты с закрытыми ключами CAPI. Due to .NET Framework limitations, only certificates with CAPI private keys are supported. Возможные решения для этих ограничений см. в приведенном ниже содержимом. See the content below for possible workarounds to these limitations.
Windows DPAPI — NG Windows DPAPI-NG
Этот механизм доступен только в Windows 8, Windows Server 2012 и более поздних версиях. This mechanism is available only on Windows 8/Windows Server 2012 or later.
Начиная с Windows 8, ОС Windows поддерживает DPAPI-NG (также называется CNG DPAPI). Beginning with Windows 8, Windows OS supports DPAPI-NG (also called CNG DPAPI). Дополнительные сведения см. в разделе About CNG DPAPI. For more information, see About CNG DPAPI.
Участник кодируется как правило дескриптора защиты. The principal is encoded as a protection descriptor rule. В следующем примере, который вызывает протекткэйсвисдпапинг, только присоединенный к домену пользователь с указанным SID может расшифровать ключевое кольцо: In the following example that calls ProtectKeysWithDpapiNG, only the domain-joined user with the specified SID can decrypt the key ring:
Также существует перегрузка без параметров ProtectKeysWithDpapiNG . There’s also a parameterless overload of ProtectKeysWithDpapiNG . Используйте этот удобный метод, чтобы указать правило «SID =
В этом сценарии контроллер домена AD отвечает за распространение ключей шифрования, используемых операциями DPAPI-NG. In this scenario, the AD domain controller is responsible for distributing the encryption keys used by the DPAPI-NG operations. Целевой пользователь может расшифровать зашифрованные полезные данные с любого компьютера, присоединенного к домену (при условии, что процесс выполняется с удостоверением). The target user can decipher the encrypted payload from any domain-joined machine (provided that the process is running under their identity).
Шифрование на основе сертификата с помощью Windows DPAPI-NG Certificate-based encryption with Windows DPAPI-NG
Если приложение выполняется в Windows 8.1/Windows Server 2012 R2 или более поздней версии, можно использовать Windows DPAPI-NG для шифрования на основе сертификата. If the app is running on Windows 8.1/Windows Server 2012 R2 or later, you can use Windows DPAPI-NG to perform certificate-based encryption. Используйте строку дескриптора правила «сертификат = Хашид: отпечаток», где отпечаток — это шестнадцатеричный отпечаток сертификата SHA1, закодированный в сертификате: Use the rule descriptor string «CERTIFICATE=HashId:THUMBPRINT», where THUMBPRINT is the hex-encoded SHA1 thumbprint of the certificate:
Любое приложение, указываемое в этом репозитории, должно выполняться на Windows 8.1/Windows Server 2012 R2 или более поздней версии для расшифровки ключей. Any app pointed at this repository must be running on Windows 8.1/Windows Server 2012 R2 or later to decipher the keys.
Шифрование с пользовательским ключом Custom key encryption
Если встроенные механизмы не подходят, разработчик может указать собственный механизм шифрования ключей, предоставив пользовательский иксмленкриптор. If the in-box mechanisms aren’t appropriate, the developer can specify their own key encryption mechanism by providing a custom IXmlEncryptor.