Skip to content

Commit 75863e3

Browse files
暗号化取り消し
1 parent bf6199e commit 75863e3

File tree

4 files changed

+2
-11
lines changed

4 files changed

+2
-11
lines changed

BrowserCookieImplementations/BrowserCookieImplementations.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
<ItemGroup>
3939
<PackageReference Include="BouncyCastle" Version="1.8.9" />
4040
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.114.3" />
41-
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.8" />
4241
<PackageReference Include="System.Text.Json" Version="9.0.8" />
4342
</ItemGroup>
4443
<ItemGroup>

BrowserCookieImplementations/Buildin.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ private List<Cookie> LoadAllCookies(string file)
8383
{
8484
// 暗号化されたファイルを読み込み
8585
var encrypted = File.ReadAllBytes(path1);
86-
87-
// DPAPI で復号
88-
var bytes = ProtectedData.Unprotect(encrypted, optionalEntropy: null, scope: DataProtectionScope.LocalMachine);
89-
var json = Encoding.UTF8.GetString(bytes);
86+
var json = Encoding.UTF8.GetString(encrypted);
9087

9188
// JSON を CookieDto のリストにデシリアライズ
9289
var cookieDtos = JsonSerializer.Deserialize<List<CookieDto>>(json);

MultiCommentViewer/CookieStorage.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,8 @@ public static async Task SaveCookiesEncryptedAsync(IEnumerable<CoreWebView2Cooki
9999
var json = System.Text.Json.JsonSerializer.Serialize(list);
100100
var bytes = Encoding.UTF8.GetBytes(json);
101101

102-
// DPAPI を使って暗号化(LocalMachine スコープ:同一マシン上の別プロセスでも復号可能)
103-
var encrypted = ProtectedData.Protect(bytes, optionalEntropy: null, scope: DataProtectionScope.LocalMachine);
104-
105102
var path = GetCookieFilePath(siteName);
106-
File.WriteAllBytes(path, encrypted);
103+
File.WriteAllBytes(path, bytes);
107104
}
108105

109106
// // 暗号化ファイルを復号して CookieContainer を返す

MultiCommentViewer/MultiCommentViewer.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@
5656
<PackageReference Include="SQLitePCLRaw.bundle_winsqlite3" Version="2.0.4" />
5757
<PackageReference Include="System.ComponentModel.Composition" Version="5.0.0" />
5858
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.114.3" />
59-
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.8" />
6059
<PackageReference Include="System.Text.Json" Version="9.0.8" />
61-
<PackageReference Include="WebView2.Runtime.X64" Version="139.0.3405.125" />
6260
<PackageReference Include="WebView2.Runtime.X86" Version="139.0.3405.125" />
6361
</ItemGroup>
6462
<ItemGroup>

0 commit comments

Comments
 (0)