What is a digital certificate?
July 12, 2023
Code signing assures users, operating systems, and security tools that an application truly comes from the claimed publisher and has not been altered since release. Without it, software can be flagged as unsafe, blocked from installation, or exploited by bad actors.
Code signing is used to authenticate the identity of the developer of a program and where it came from, while also confirming that the software has not been altered since it was signed.
By code-signing a program, application, executable, or script, a developer is attaching a digital certificate that confirms their identity and the integrity of the software. Code signing certificates use public-key cryptography, which is the same technology that is used with other types of digital certificates. This approach is supported across operating systems and platforms, from mobile to desktop environments to embedded systems. Code signing is widely used in Windows by Microsoft, Mac OS X by Apple, Linux distributions, as well as on iOS and Android.
As cyber threats increasingly target gaps in software trust, code signing has become a frontline defense against tampering, malware distribution, and supply chain attacks.
Implementing strong code signing practices is therefore critical for software publishers and development organizations seeking to protect users, maintain platform trust, and ensure software can be delivered safely and reliably. The following best practices help to address the most common risks associated with code signing security:
Monitor and audit signing activity: Without visibility, misuse may go unnoticed until damage occurs. Maintain detailed logs of code signing events, access, approvals, and timestamps. Regular reviews help detect anomalies and support investigations.
To implement code signing, a unique cryptographic key pair is required. This consists of a private key, which is kept secret, and a public key, which can be shared. Together, they form the foundation of public key cryptography and allow software to be signed without exposing the private key.
After generating the new key pair using public key infrastructure (PKI), the public key is sent to a certificate authority (CA) as part of a certificate signing request (CSR). The CA verifies the identity of the developer or organization and issues the code signing certificate.
Now that the developer is in possession of the certificate, they must hash the software’s code. Hashing is a procedure in which a hash function is used to convert code into an arbitrary fixed value. The output of hashing, called a digest, is then encrypted using the private key. Next, the developer combines this digest with the code signing certificate and the hash function to create something called a signature block, which is essentially all of the above items combined into a piece of code that can be conveniently inserted into the software.
The biggest issue with code signing is the protection of the private code signing key associated with the certificate. If a key is compromised, the certificate loses trust and value, jeopardizing the software that you have signed.
Many organizations protect themselves using secure vaults and Hardware Security Modules (HSMs) to increase the degree of security their private keys get. Others use certificate management platforms made to automate and secure the lifecycle management of all code signing certificates. An example of one is the Sectigo Certificate Manager. The use of a certificate manager goes a long way towards promoting the integrity of private keys and other encryption assets.
Simply, code signing helps prevent malware and other malicious code from being introduced to an end-user's system under the disguise of a benign file or event such as a Windows update. It accomplishes this by allowing users to authenticate that the file being downloaded does come from the originator rather than a malicious actor. This reinforces the concept of trust within the system, allowing developers to assure the end-users downloading the software that the source can be trusted and is safe.
EV Code Signing Certificates offer additional assurances of security. They require that the key be stored in a high assurance, FIPS 140-2 or above standard-compliant hardware. There are USB tokens that meet this requirement and add another layer of protection with a PIN. Alternatively, you could store the key(s) in your organization’s HSM on-premises.
Research from Georgia Tech’s Cyber Forensics Innovation Lab shows that issuance and use of Extended Validation (EV) SSL/TLS certificates results in 99.99% likelihood to be free of phishing attacks and abuse. The white paper, which was sponsored by Sectigo, can be downloaded here.
Following these code signing best practices greatly reduces the risk of unauthorized software distribution, security warnings during installation, and loss of user trust. It can also lead to higher installation rates and smoother adoption of your software.
Certificates issued by trusted authorities are widely recognized by operating systems and security platforms. Sectigo is a leading Certificate Authority offering fast, flexible code signing solutions. Our code signing certificates help publishers establish trust, protect users from tampered code, and ship software faster. Learn about the different types of code signing certificates that Sectigo offers, or reach out to our expert team for further information.