Log date · Mon
Does Windows hardening require Authenticode re-signing?
Published on · Updated
Usually. Finish hardening first, then sign, timestamp and verify the final Windows files. Signing does not conceal algorithms.
The answer: sign and verify after changes
Usually, yes. If hardening changes executable content covered by Authenticode, the original signature cannot validate that changed content. Finish transformations first, then sign, timestamp and verify the final file. [1][2] Signing addresses publisher identity and integrity; it does not hide the program’s algorithms.
Our macOS environment has no osslsigncode and no Windows machine. The two file states and commands below are a worked example based on Microsoft documentation, not executed; their outcomes are expectations, not test results.
| Question | Answer |
|---|---|
| Does the old signature survive hardening? | Not when covered content changes; sign and verify the final artifact. |
| Is every byte protected? | No. The PE signature hash excludes certain fields. |
| Is every signed file trusted? | No. Verification also depends on certificate chain, revocation and policy. |
| Does signing conceal algorithms? | No. It is not a code secrecy mechanism. |
Two build states: before and after signing
Imagine a release with an app EXE, a DLL and an installer. The team builds, hardens the EXE and DLL, then signs the files and packages them. If the installer is signed too, sign it after its contents are fixed and it has been built; inserting another version afterward cannot reuse the previous verification result.
Compare two states of the same EXE: A is the signed build; B is a copy whose covered code was rewritten by a hardening tool. Verification of A still depends on a trusted certificate and the verification policy. B’s old signature should fail because the content digest no longer matches. After signing B again, independently check its signer, timestamp and runtime behavior. [1][2]
| State | What to check |
|---|---|
| A: signed, unchanged | Should pass when signature, certificate chain and policy all validate. |
| B: covered code changed after signing | Old signature should fail; sign final B and verify again. |
| B: covered code changed again after re-signing | The later change also invalidates the new verification result. |
A real pipeline needs an inventory of inputs and outputs, especially the order of hardening, resource edits, version stamping, packaging and signing. Verify the file being delivered, not an earlier copy with the same name in a build directory. Keep a separate SHA-256 and verification log for the release artifact so the team can establish that testing and delivery refer to the same file.
Signature coverage and trust
Microsoft explains that the Authenticode PE hash excludes fields including the checksum and certificate-table directory; signatures may be embedded in the file or stored in a catalog. [2] A valid signature is therefore not a byte-for-byte comparison with an archived file. When exact file identity matters, compare a separate file hash obtained through a trusted channel.
Seeing a certificate in file properties is only a clue. Verification also checks whether its chain is trusted, whether the certificate was revoked and which policy applies. A self-signed certificate can exercise a workflow in an isolated environment; it does not by itself establish a publisher identity trusted by recipients. Do not install a root certificate on users’ machines merely to make a release check pass. [1]
Even a validly signed program does not thereby encrypt its algorithms, strings or resources. If the goal is to reduce the value of code analysis, define a separate threat model, evaluate transformations and server-side boundaries, and measure the tradeoffs with functionality, performance and compatibility tests.
Timestamp and verification policy
A timestamp lets a verifier determine when the signature was made, so a signature may remain verifiable after the signing certificate expires; it does not eliminate chain, revocation or policy checks. [3] In SignTool, /tr selects an RFC 3161 service, /td its digest algorithm and /fd the file digest algorithm. Use your actual service address: the placeholder below is not a release endpoint.
signtool sign /n "Your Company" /fd SHA256 /tr https://timestamp.example.com /td SHA256 MyApp.exe
signtool verify /pa /all /tw /v MyApp.exeThe /n selector matches a certificate subject and can match more than one certificate. A production pipeline should select the intended certificate explicitly and check the final signer. /pa chooses the default authentication policy, /all checks multiple signatures, /tw warns when a timestamp is missing, and /v requests details. [1] Inspect warnings: Microsoft lists exit codes 0 for success, 1 for failure and 2 for completion with warnings. Do not treat every non-failure message as a pass.
Match verification to the signing arrangement. Default verification examines the embedded signature; /a searches catalogs for a file that might be catalog-signed, while /c names a known catalog. Drivers have their own verification policy and release requirements, so do not assume the ordinary desktop /pa command is sufficient. [1][4]
Recommendations by release scenario
These are release-process recommendations. Confirm the precise policy for the file type, certificate and target environment.
| Case | Recommendation |
|---|---|
| Hardening rewrites EXE or DLL | Harden and test first, then sign, timestamp and verify the final files. |
| Installer contains signed files | Sign inner files first, build and sign the installer, then verify each. |
| File may be catalog-signed | Identify the catalog and target policy; verify the actual signing arrangement. |
| Certificate rotation or timestamp failure | Inspect signer and warnings; repair the process and verify the final artifact again. |
| Driver or managed enterprise environment | Use the relevant policy and test on target devices, including deployment restrictions. |
Signing is one gate in the release chain, not functional acceptance. Hardening can affect loading, plugins, updates or performance. Install, launch, upgrade and uninstall on representative clean devices and record security software prompts. Investigate the file, certificate and distribution process before responding to a prompt; do not ask users to disable system protection.
Check your own Windows release
On a Windows build machine with the Windows SDK and SignTool, verify the final EXE and DLL separately, then the installer. The commands below use paths you can change; in PowerShell, $LASTEXITCODE holds the previous native command’s exit code. Record full output, signer, timestamp and file hash, and investigate warnings. [1]
signtool verify /pa /all /tw /v ".\release\MyApp.exe"
$LASTEXITCODE
signtool verify /pa /all /tw /v ".\release\MyLibrary.dll"
$LASTEXITCODE
signtool verify /pa /all /tw /v ".\release\Setup.exe"
$LASTEXITCODE
Get-FileHash -Algorithm SHA256 ".\release\MyApp.exe"If verification fails, first confirm that this is the final copy and the correct policy is in use, then inspect diagnostics for digest mismatch, certificate chain, revocation checks and timestamp. Do not merely rerun signing to conceal the cause: locate the last file modification, fix the order, sign again and repeat verification on the final artifact.
When archiving logs, associate each artifact’s path, version, hash, signer, timestamp and verification result with the same build. After transfer to a distribution channel, obtain the file actually delivered and check its hash and signature again, then validate install and update in the target environment. This catches repackaging or replacement after the build completed.
Your checklist
- Inventory EXEs, DLLs, installers and their signing methods.
- Complete hardening and resource edits before final signing.
- Check signer, certificate chain, timestamp and verification warnings.
- Record hashes and verification logs for delivered artifacts.
- Test installation, launch, upgrade and uninstall on target devices.
Primary sources
- Microsoft: SignTool · Checked 2026-11-11
- Microsoft: Understanding executable file signing · Checked 2026-11-11
- Microsoft: Time stamping Authenticode signatures · Checked 2026-11-11
- Microsoft: Authenticode digital signatures · Checked 2026-11-11