From e72c3b8e4fa0dc16312e8256230292595ffd9510 Mon Sep 17 00:00:00 2001 From: Srihariharan Date: Thu, 1 Feb 2024 09:19:25 +0530 Subject: [PATCH 1/5] 868485: Added code sample for troubleshooting in security. --- Security/troubleshooting/.NET/ConsoleApp1.sln | 25 ++++++++++++++++++ .../.NET/ConsoleApp1/ConsoleApp1.csproj | 14 ++++++++++ .../.NET/ConsoleApp1/OwnerPasswordOnly.pdf | Bin 0 -> 10715 bytes 3 files changed, 39 insertions(+) create mode 100644 Security/troubleshooting/.NET/ConsoleApp1.sln create mode 100644 Security/troubleshooting/.NET/ConsoleApp1/ConsoleApp1.csproj create mode 100644 Security/troubleshooting/.NET/ConsoleApp1/OwnerPasswordOnly.pdf diff --git a/Security/troubleshooting/.NET/ConsoleApp1.sln b/Security/troubleshooting/.NET/ConsoleApp1.sln new file mode 100644 index 00000000..41ac9e42 --- /dev/null +++ b/Security/troubleshooting/.NET/ConsoleApp1.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34330.188 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{F791E0B1-C642-4323-80E3-6194633CEFFE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F791E0B1-C642-4323-80E3-6194633CEFFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F791E0B1-C642-4323-80E3-6194633CEFFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F791E0B1-C642-4323-80E3-6194633CEFFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F791E0B1-C642-4323-80E3-6194633CEFFE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F9DF932F-EB48-4DE6-A052-C05C40E70DAF} + EndGlobalSection +EndGlobal diff --git a/Security/troubleshooting/.NET/ConsoleApp1/ConsoleApp1.csproj b/Security/troubleshooting/.NET/ConsoleApp1/ConsoleApp1.csproj new file mode 100644 index 00000000..bb378409 --- /dev/null +++ b/Security/troubleshooting/.NET/ConsoleApp1/ConsoleApp1.csproj @@ -0,0 +1,14 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + diff --git a/Security/troubleshooting/.NET/ConsoleApp1/OwnerPasswordOnly.pdf b/Security/troubleshooting/.NET/ConsoleApp1/OwnerPasswordOnly.pdf new file mode 100644 index 0000000000000000000000000000000000000000..08e805b066aab4ea5d37629856f140e976dc2eed GIT binary patch literal 10715 zcmd6NWmFv9wk_@i3m%|xr|G6~hem^2aBn2I1qtp14Hg^%!6CRyaEA~)Xz<_?-15jL z=R5D--1F|wS7UT_RaezsYt21Z?Xgx*dKIWNJBWh^n|^Km^CUI~2n65+IGDb~77_v~ zSlh!)oUOfJ<^T{-0RZCU1#ttF0U!ua3cv&5<^w7{{;u)(I~PAMP!^yEfbjAIKzy7A zA|lu@d-GqT0RH=ijREHT#|9K;=3ov}F>$tYd9*0$VC!aQ?*f1TRh(hw)@H5_&HxZt zLf{C1pxB`H9Q?* zKy5Xc1@MI)2ml6v9szN2b%vSPVPjY=o0^*A8XKD$zeK^0nhih-!U?a#hUz2Y3t=!2i|t3jnSt04sFaI<1dO>5>ey{{3Wxo{KI0+ z9LCnqK<;aJhl+L)`JBtl+G|z{4d1v>M3X4i#>3DDeiPCkbNm+tC8Zx(q3&w_$G5nf ztCiF%n7u0y>R_hq2(t%DN-F}zrPQ^+e+L2L5qaGH=7+kgiM_drv-!WSg86{TOi!9g z(KbibtHP;ycs-R0wD}Oc6V`(h>olQfyn6b~3USOp6#zSklN$_Fdt{=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ph%?qk qTx&;`UzA00A|)|FniK_e4!}KX0L$o5D1JkUf71YhKs^6a0sbErmRhv{ literal 0 HcmV?d00001 From 03233ae053a06ecfb76dd3db4ca960b667d8fc3e Mon Sep 17 00:00:00 2001 From: Srihariharan Date: Thu, 1 Feb 2024 09:19:51 +0530 Subject: [PATCH 2/5] 868485: Added missing files. --- .../troubleshooting/.NET/ConsoleApp1/Program.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Security/troubleshooting/.NET/ConsoleApp1/Program.cs diff --git a/Security/troubleshooting/.NET/ConsoleApp1/Program.cs b/Security/troubleshooting/.NET/ConsoleApp1/Program.cs new file mode 100644 index 00000000..43884120 --- /dev/null +++ b/Security/troubleshooting/.NET/ConsoleApp1/Program.cs @@ -0,0 +1,16 @@ +using Syncfusion.Pdf.Parsing; +using Syncfusion.Pdf.Security; +using System.Security.Cryptography; + +FileStream fileStream = new FileStream("OwnerPasswordOnly.pdf", FileMode.Open, FileAccess.Read); +PdfLoadedDocument loadedDocument = new PdfLoadedDocument(fileStream, "12345"); +PdfSecurity security = loadedDocument.Security; +loadedDocument.FileStructure.IncrementalUpdate = false; +loadedDocument.Security.Permissions = PdfPermissionsFlags.EditAnnotations | PdfPermissionsFlags.AssembleDocument; +security.Algorithm = PdfEncryptionAlgorithm.AES; +security.OwnerPassword = ""; +security.UserPassword = ""; +MemoryStream stream = new MemoryStream(); +loadedDocument.Save(stream); +File.WriteAllBytes("output.pdf", stream.ToArray()); +loadedDocument.Close(true); From 93686cddf49d745389e6650fb3959c5aca5c0d84 Mon Sep 17 00:00:00 2001 From: Srihariharan Date: Thu, 1 Feb 2024 12:53:47 +0530 Subject: [PATCH 3/5] 868485: Added comment line for the sample. --- Security/troubleshooting/.NET/ConsoleApp1/Program.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Security/troubleshooting/.NET/ConsoleApp1/Program.cs b/Security/troubleshooting/.NET/ConsoleApp1/Program.cs index 43884120..b715ca39 100644 --- a/Security/troubleshooting/.NET/ConsoleApp1/Program.cs +++ b/Security/troubleshooting/.NET/ConsoleApp1/Program.cs @@ -2,15 +2,27 @@ using Syncfusion.Pdf.Security; using System.Security.Cryptography; +// Open a FileStream for reading the PDF file. FileStream fileStream = new FileStream("OwnerPasswordOnly.pdf", FileMode.Open, FileAccess.Read); +// Load the PDF document from the FileStream with the specified owner password. PdfLoadedDocument loadedDocument = new PdfLoadedDocument(fileStream, "12345"); +// Access the security settings of the loaded PDF document. PdfSecurity security = loadedDocument.Security; +// Disable incremental update for the file structure. loadedDocument.FileStructure.IncrementalUpdate = false; +// Set specific permissions for a PDF document. loadedDocument.Security.Permissions = PdfPermissionsFlags.EditAnnotations | PdfPermissionsFlags.AssembleDocument; +// Set the encryption algorithm to AES for the document security. security.Algorithm = PdfEncryptionAlgorithm.AES; +// Set the owner password for a PDF document. security.OwnerPassword = ""; +// Set the user password for a PDF document. security.UserPassword = ""; +// Create a MemoryStream to store the modified PDF document. MemoryStream stream = new MemoryStream(); +// Save the modified PDF document to the MemoryStream. loadedDocument.Save(stream); +// Write the contents of the MemoryStream. File.WriteAllBytes("output.pdf", stream.ToArray()); +// Close the loaded PDF document. loadedDocument.Close(true); From 20fb464662460b7beb5582bbce654a68e65bba91 Mon Sep 17 00:00:00 2001 From: Srihariharan Date: Thu, 1 Feb 2024 13:25:07 +0530 Subject: [PATCH 4/5] 868485: Update the encryption key size. --- Security/troubleshooting/.NET/ConsoleApp1/Program.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Security/troubleshooting/.NET/ConsoleApp1/Program.cs b/Security/troubleshooting/.NET/ConsoleApp1/Program.cs index b715ca39..37734d6f 100644 --- a/Security/troubleshooting/.NET/ConsoleApp1/Program.cs +++ b/Security/troubleshooting/.NET/ConsoleApp1/Program.cs @@ -14,15 +14,14 @@ loadedDocument.Security.Permissions = PdfPermissionsFlags.EditAnnotations | PdfPermissionsFlags.AssembleDocument; // Set the encryption algorithm to AES for the document security. security.Algorithm = PdfEncryptionAlgorithm.AES; -// Set the owner password for a PDF document. -security.OwnerPassword = ""; -// Set the user password for a PDF document. -security.UserPassword = ""; +// Set the encryption key size to 256 Bit. +security.KeySize = PdfEncryptionKeySize.Key256Bit; // Create a MemoryStream to store the modified PDF document. MemoryStream stream = new MemoryStream(); // Save the modified PDF document to the MemoryStream. loadedDocument.Save(stream); -// Write the contents of the MemoryStream. -File.WriteAllBytes("output.pdf", stream.ToArray()); // Close the loaded PDF document. loadedDocument.Close(true); +// Write the contents of the MemoryStream. +File.WriteAllBytes("output.pdf", stream.ToArray()); + From 7c1b8ed0997194c702aafa7265e58bf6ddf3e958 Mon Sep 17 00:00:00 2001 From: Srihariharan Date: Thu, 1 Feb 2024 15:28:19 +0530 Subject: [PATCH 5/5] 868485: Update proper app name. --- Security/troubleshooting/.NET/ConsoleApp1.sln | 25 ---------------- .../.NET/ConsoleApp1/ConsoleApp1.csproj | 14 --------- .../.NET/ConsoleApp1/OwnerPasswordOnly.pdf | Bin 10715 -> 0 bytes .../.NET/ConsoleApp1/Program.cs | 27 ------------------ 4 files changed, 66 deletions(-) delete mode 100644 Security/troubleshooting/.NET/ConsoleApp1.sln delete mode 100644 Security/troubleshooting/.NET/ConsoleApp1/ConsoleApp1.csproj delete mode 100644 Security/troubleshooting/.NET/ConsoleApp1/OwnerPasswordOnly.pdf delete mode 100644 Security/troubleshooting/.NET/ConsoleApp1/Program.cs diff --git a/Security/troubleshooting/.NET/ConsoleApp1.sln b/Security/troubleshooting/.NET/ConsoleApp1.sln deleted file mode 100644 index 41ac9e42..00000000 --- a/Security/troubleshooting/.NET/ConsoleApp1.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.8.34330.188 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{F791E0B1-C642-4323-80E3-6194633CEFFE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F791E0B1-C642-4323-80E3-6194633CEFFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F791E0B1-C642-4323-80E3-6194633CEFFE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F791E0B1-C642-4323-80E3-6194633CEFFE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F791E0B1-C642-4323-80E3-6194633CEFFE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {F9DF932F-EB48-4DE6-A052-C05C40E70DAF} - EndGlobalSection -EndGlobal diff --git a/Security/troubleshooting/.NET/ConsoleApp1/ConsoleApp1.csproj b/Security/troubleshooting/.NET/ConsoleApp1/ConsoleApp1.csproj deleted file mode 100644 index bb378409..00000000 --- a/Security/troubleshooting/.NET/ConsoleApp1/ConsoleApp1.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - Exe - net8.0 - enable - enable - - - - - - - diff --git a/Security/troubleshooting/.NET/ConsoleApp1/OwnerPasswordOnly.pdf b/Security/troubleshooting/.NET/ConsoleApp1/OwnerPasswordOnly.pdf deleted file mode 100644 index 08e805b066aab4ea5d37629856f140e976dc2eed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10715 zcmd6NWmFv9wk_@i3m%|xr|G6~hem^2aBn2I1qtp14Hg^%!6CRyaEA~)Xz<_?-15jL z=R5D--1F|wS7UT_RaezsYt21Z?Xgx*dKIWNJBWh^n|^Km^CUI~2n65+IGDb~77_v~ zSlh!)oUOfJ<^T{-0RZCU1#ttF0U!ua3cv&5<^w7{{;u)(I~P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Sm`DC;nl;S?ZjjlwE4$SBz4oA1hHC= zWPh@?>O$Mq3X)n*wB{y76&FS*FayddGD-oR-U<1$TZ{O`MWF5 zk3ZmXMzjZYOh|IEoW7_?%@^A-nP6NZjXU!T8wRiveRGz|eero)&HCz!eDpah@1dMX zr)SPX-GlG2^((jDJGpmV*>S9&C~Sx$(01Hk^P~YxvjytCvAj9$O%w^r@Cjc&0$qJ#G0M+hpV{1dFWPE6&_#=lzam)VaBh*xXl^QdDBPFC#jwIj*A{GHauX^ z^au*|q%m@Wg)_Be;~TZ|*r|62QIo%B-qLSCu&74RpqF(+Qbq#X8Z`X0Zx=cFnn(;B_f7jXgH^I>Vk3zx!rVWJrMi2=43;zEg2!ummkd|XbVL<6~7Yn@Ph%?qk qTx&;`UzA00A|)|FniK_e4!}KX0L$o5D1JkUf71YhKs^6a0sbErmRhv{ diff --git a/Security/troubleshooting/.NET/ConsoleApp1/Program.cs b/Security/troubleshooting/.NET/ConsoleApp1/Program.cs deleted file mode 100644 index 37734d6f..00000000 --- a/Security/troubleshooting/.NET/ConsoleApp1/Program.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Syncfusion.Pdf.Parsing; -using Syncfusion.Pdf.Security; -using System.Security.Cryptography; - -// Open a FileStream for reading the PDF file. -FileStream fileStream = new FileStream("OwnerPasswordOnly.pdf", FileMode.Open, FileAccess.Read); -// Load the PDF document from the FileStream with the specified owner password. -PdfLoadedDocument loadedDocument = new PdfLoadedDocument(fileStream, "12345"); -// Access the security settings of the loaded PDF document. -PdfSecurity security = loadedDocument.Security; -// Disable incremental update for the file structure. -loadedDocument.FileStructure.IncrementalUpdate = false; -// Set specific permissions for a PDF document. -loadedDocument.Security.Permissions = PdfPermissionsFlags.EditAnnotations | PdfPermissionsFlags.AssembleDocument; -// Set the encryption algorithm to AES for the document security. -security.Algorithm = PdfEncryptionAlgorithm.AES; -// Set the encryption key size to 256 Bit. -security.KeySize = PdfEncryptionKeySize.Key256Bit; -// Create a MemoryStream to store the modified PDF document. -MemoryStream stream = new MemoryStream(); -// Save the modified PDF document to the MemoryStream. -loadedDocument.Save(stream); -// Close the loaded PDF document. -loadedDocument.Close(true); -// Write the contents of the MemoryStream. -File.WriteAllBytes("output.pdf", stream.ToArray()); -