eMudhra's Digital Security Blog: Insights and Innovations

Code Signing Certificate and Best Practices around it

Written by eMudhra Limited | Jul 26, 2023 3:40:00 AM

In an era dominated by software, the vital role of trust cannot be overstated. Yet, identifying which software is trustworthy and which requires caution can be a daunting task. Here is where the practice of code signing comes into play. Code signing enables software developers to authenticate their creations and guarantee their legitimate origins, devoid of any unauthorized changes. At the heart of code signing is the use of cryptographic techniques, chiefly embodied in the code signing certificate.

In this article, we will explore the critical aspects of the invaluable code-signing certificate, including the necessity for code signing, its operational mechanisms, and potential vulnerabilities.

What is Code Signing?

Code signing is a cryptographic process that digitally authenticates executables and scripts, confirming the legitimacy of the software publisher and ensuring the code remains unchanged post-signing. Certificate authorities (CAs) such as eMudhra, are entrusted with verifying the identities of signatories and associating their public keys with code signing certificates. These certificates then facilitate the validation of code signatures against a widely accepted and trusted root certificate, extensively used in popular applications like Windows or Java.

Why Code Signing?

Today, all consumer computing devices come pre-loaded with software. However, it's crucial to understand that this pre-installed software may not suffice for the device's entire lifespan. Be it a personal computer or a mobile device, users often require additional software or applications, leading them to download from external sources. Alternatively, a website or application might prompt users to upgrade, patch, or augment their existing software to utilize specific services. This prompts users to decide quickly whether to "Install or Don't Install". In such cases, users must decide whether they should execute the downloaded code. The challenge lies in enabling users to make informed decisions and establish trust in the software.

Code signing serves as a valuable tool to help users assess the trustworthiness of software before installation. Software publishers can digitally sign their code, using a digital signature to confirm the code's origin and integrity, assuring it remains untampered. This digital signature is supported by a certificate issued by a trusted Certificate Authority (CA) acting as a third-party validator. As a result, digitally signed code has a higher level of credibility compared to unsigned code.

Unsigned code should be approached with caution, as it lacks proof of origin or file integrity, making the publisher unaccountable for potential mishaps and prone to tampering. By adopting code signing, users can better protect their devices and data, making informed choices when dealing with software installations and updates.

Minimum Certificate Signing Requirements

Although the CA/Browser Forum hasn't publicized the exact minimum requirements for code signing, several criteria correspond with their baseline requirements. These encompass:

  • Publisher identity: The common name in the code signing certificate should denote the publisher's legal name. The organization name can mirror the publisher's legal name or a "doing business as" (DBA) name.

  • Minimum key size: Code signing certificates must deploy a minimum key size of 3072-bit RSA to guarantee robust security.

  • Validity period: The maximum validity period for code signing certificates is 39 months, ensuring regular updates and renewals.

  • High-risk requests: Certificate Authorities (CAs) must cross-check databases to prevent issuing code signing certificates to known producers of suspicious code, thus reducing potential threats.

  • Private key protection: Considering the risks of compromised keys signing suspect code, private keys must be encrypted on hardware devices or stored separately from the host running the signing software function.

  • Takeover attack: Publishers with a history of experiencing a takeover attack will need enhanced private key protection to prevent unauthorized access.

  • Certificate revocation: Clear revocation processes are in place, including accepting revocation requests from application software suppliers like Microsoft.

  • Time stamping: Specific requirements for certification authorities, time-stamp certificates, and time-stamp authorities (TSA) have been laid out to ensure accurate time stamping of the signed code.

Vulnerability Associated with Code-Signing Certificates

Despite the significant benefits of a code-signing certificate, enterprises must stay alert to potential vulnerabilities. The critical areas of vulnerability related to code signing certificates include:

  • Key theft: The private keys linked with code signing certificates are a prime target for hackers. Acquiring these private keys allows unauthorized parties to produce seemingly legitimate software from a reputable source, facilitating the distribution of harmful code.

  • Signing breach: In some instances, hackers may bypass the need for direct access to the private keys. Instead, they can penetrate a developer's workstation with unrestricted access to the code signing certificate. Once inside, malevolent actors can submit their malicious software for signature and distribution without the original private keys.

  • Internal misuse: The constant risk of human error also applies to code signing certificates. If a developer unintentionally misuses or misplaces the corresponding code signing key, it could provide an entry point for hackers to exploit and disrupt organizational operations.

Given these potential vulnerabilities, it is crucial for organizations to enact stringent security measures and protocols to protect code-signing certificates effectively.

Best Practices 

It involves critical concern in protecting the private signing key associated with the code signing certificate. To maintain stringent security standards in code signing, the following best practices are recommended:

  • Restrict access to private keys

  • Utilize cryptographic hardware products for key protection, such as products with FIPS 140 Level 2 certification or higher.

  • Timestamp code

  • Distinguish between test-signing and release-signing

  • Authenticate the code before signing

  • Perform virus scanning before signing

  • Diversify certificates to reduce risk. This includes using multiple certificates and avoiding over-reliance on a single key.

By following these best practices, organizations can enhance the robustness and credibility of their code signing practices, securing software authenticity and preserving user confidence.

But how does one procure code signing certificates?

eMudhra is a leading provider of digital transformation services and solutions, offering an extensive range of services designed to simplify and secure online transactions and communications. Our expertise spans various domains, including digital signatures, identity management, cybersecurity, and more. In accordance with the guidelines of IT-Act (India), global regulations, and the X.509 Certificate Policy, we issue six types of certificates through our global trust root, emSign: Signature, Encryption, Device/System, SSL Server, Code Signing, and Document Signer Certificate.

This cryptographic signature acts as a tamper-proof seal that verifies the code's origin and integrity. Consequently, users can trust that the software they are installing is genuine and hasn't been tampered with by malicious entities. Additionally, major operating systems and web browsers recognize and trust eMudhra's Code Signing Certificates. This trust association enables developers to reach a broader audience without triggering security warnings that could deter potential users from installing their applications.

Our certificates empower developers to protect their code, instill confidence in end-users, and establish a strong presence in the competitive digital landscape.

Contact us today to learn more about our code-signing certificates.