2022年9月19日 星期一

[研究]Web.Config資料庫連線字串加解密 (加密、解密)

[研究]Web.Config資料庫連線字串加解密 (加密、解密)

2022-09-19

工具

aspnet_regiis.exe   /?

https://docs.microsoft.com/zh-tw/aspnet/web-forms/overview/data-access/advanced-data-access-scenarios/protecting-connection-strings-and-other-configuration-information-cs

********************************************************************************

加密

需要「系統管理員: 命令提示字元」,只有「命令提示字元」權限不夠。

cd   C:\Windows\Microsoft.NET\Framework64\v4.0.30319

aspnet_regiis.exe   -pef   資料庫連線字串區段名稱   "原始碼Web.Config所在目錄"

範例

aspnet_regiis.exe   -pef   connectionStrings   C:\CodeTemp\WebApplication1\WebApplication1

********************************************************************************

解密

需要「系統管理員: 命令提示字元」,只有「命令提示字元」權限不夠。

cd   C:\Windows\Microsoft.NET\Framework64\v4.0.30319

aspnet_regiis.exe   -pdf   資料庫連線字串區段名稱   "原始碼Web.Config所在目錄"

範例

aspnet_regiis.exe   -pdf   connectionStrings   C:\CodeTemp\WebApplication1\WebApplication1

********************************************************************************

注意,某系統在開發機加密測試正常,但正式機上加密後連不上。

********************************************************************************

(完)

相關

[研究]Web.Config資料庫連線字串加解密
https://shaurong.blogspot.com/2022/09/webconfig.html

[研究]Web.Config資料庫連線字串加密、解密失敗:執行 connectionStrings 的組態區段處理常式時發生錯誤
https://shaurong.blogspot.com/2022/09/webconfig-connectionstrings.html

[研究][ASP.NET]Multiple Web.Config files 的資料庫連線字串加密測試
https://shaurong.blogspot.com/2022/08/aspnetmultiple-webconfig-files.html

[研究][ASP.NET]Fortify SCA報告Password Management: Password in Configuration File 問題,與Web.Config資料庫連線字串加密後拿去別台可用性測試https://shaurong.blogspot.com/2022/04/aspnetfortify-scapassword-management.html

[研究][ASP.NET] Fortify SCA 報告 Web.Config 資料庫連線字串設定有 Insecure Transport: Database 問題
https://shaurong.blogspot.com/2018/12/fortify-sca-webconfig.html

保護連接字串和其他組態資訊 (C#) | Microsoft Learn
https://learn.microsoft.com/zh-tw/aspnet/web-forms/overview/data-access/advanced-data-access-scenarios/protecting-connection-strings-and-other-configuration-information-cs

[研究][Fortify SCA]原始碼變數最好不要包含的字串

[研究]Fortify SCA對Web.Config中 Password Management: Password in Configuration File 的關鍵字認定

[研究][ASP.NET] Fortify SCA 報告 Web.Config 中 add key 有 Password Management Password in Configuration 問題

[研究][ASP.NET]Fortify SCA 報告Password Management: Empty Password 和 Hardcoded Password
https://shaurong.blogspot.com/2021/07/aspnetfortify-sca-password-management.html

逐步解說:使用受保護的組態加密組態資訊
Visual Studio 2010 更新:2007 年 11 月
https://msdn.microsoft.com/zh-tw/library/dtkwfdky(v=vs.100).aspx

HOW TO:建置並執行受保護的組態提供者範例
Visual Studio 2010 更新:2007 年 11 月
https://msdn.microsoft.com/zh-tw/library/33ws57y0(v=vs.100).aspx

匯入和匯出受保護的組態 RSA 金鑰容器
Visual Studio 2010 更新:2007 年 11 月
https://msdn.microsoft.com/zh-tw/library/yxw286t2(v=vs.100).aspx


沒有留言:

張貼留言