【发布时间】:2023-03-08 03:58:01
【问题描述】:
当您告诉 Visual Studio 保存发布配置文件的密码时,它会在您的发布文件旁边创建一个 .pubxml.user 文件,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANC[...]</EncryptedPassword>
</PropertyGroup>
</Project>
Visual Studio 如何实际加密EncryptedPassword 元素中的密码?我想解密它,因为我忘记了密码……现在它只是加密存储在这个文件中!
【问题讨论】:
-
基于开头
AQAAANC的纯猜测:开头是AQAAANCMnd8BFdERjHoAwE/Cl+(这是0x01000000D08C9DDF0115D1118C7A00C04FC297EB的Base64编码)?那么它们可能是 DPAPI 加密的。在对数据进行 Base64 解码后,应该可以使用 C# 类ProtectedData进行解密,更准确地说是使用方法ProtectedData.Unprotect(请参阅链接文档以获取示例)。如果s_aditionalEntropy没有已知值,我会尝试null。 -
@Topaco 请给出这个答案,我可以奖励赏金。
标签: visual-studio encryption passwords visual-studio-2019 webdeploy