This invention relates in general to the field of computer software. More particularly, this invention relates to a system and method of providing software developers with a way to store private keys used for signing assemblies and/or the installation of trusted components.
One of the larger questions facing the software industry is how can users trust code that is published on the Internet. Packaged software uses branding and trusted sales outlets to assure users of its integrity, but these are not available when code is transmitted on the Internet. Additionally, there is no guarantee that the code has not been altered while being downloaded. While browsers typically exhibit a warning message explaining the possible dangers of downloading data, they do nothing to actually see whether the code is what it claims to be. A more active approach must be taken to make the Internet a reliable medium for distributing software.
One way to verify the authenticity of software is through the use of digital signatures. However, smaller developers find that digitally signing software is difficult because of the necessity to manage the private keys used to sign the code. This is because each developer needs access to the private key to run and debug applications. Further, if a key is compromised, other applications can use the private key to spoof the identity of the original application and thereby obtain unauthorized access to resources and privileges that had been granted to that application.
Thus, there is a need for a system of signing software applications that provides a globally unique, verifiable identity for a given application. There is also a need for a system for using private keys in software development that minimizes the risks of the private key being lost or stolen. There is a need for a simple, cost effective system that allows developers within a small team to safely share a private key while minimizing the risks of it being lost or stolen. The present invention provides such a solution.
The present invention is directed to systems and methods for storing a private key used for digitally signing software code. The method includes creating a private/public key pair; providing a password for the private/public key pair; persisting the private/public key pair in a file; entering the password a first time a development environment requires a private key in the private/public key pair to sign software code; and thereafter storing the private/public key pair in a cryptographic store. The file may be a personal information exchange syntax standard format.
According to a feature of the invention, the method includes naming the private/public key pair in the cryptographic store using a unique hash. In addition, the private/public key pair may be marked as non-exportable. Subsequent attempts to use the private key are redirected to the cryptographic store. In addition, a user interface may be provided to digitally sign the software code.
According to another aspect of the invention, there is provided a method for digitally signing software code using a private key provided in a password protected an encrypted key pair file. The method includes receiving the encrypted key pair file; providing a password for the key pair file; storing the key pair in a cryptographic store; and signing the software code using the private key from the cryptographic store.
In accordance with another aspect of the invention, there is provided a system for creating and digitally signing software. The system includes a key pair generating tool and an application programming interface for creating, retrieving, signing and importing a password protected key pair file. The key pair generation tool is adapted to create a key pair, and import, retrieve and display information about an existing key pair. The application programming interface is exposed to development tools to digitally sign software using a private key from the key pair file that is stored in a cryptographic store.
Additional features and advantages of the invention will be made apparent from the following detailed description of illustrative embodiments that proceeds with reference to the accompanying drawings.
The foregoing summary, as well as the following detailed description of preferred embodiments, is better understood when read in conjunction with the appended drawings. For the purpose of illustrating the invention, there is shown in the drawings exemplary constructions of the invention; however, the invention is not limited to the specific methods and instrumentalities disclosed. In the drawings:
The invention is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to, personal computers, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network or other data transmission medium. In a distributed computing environment, program modules and other data may be located in both local and remote computer storage media including memory storage devices.
With reference to
Computer 110 typically includes a variety of computer readable media. Computer readable media can be any available media that can be accessed by computer 110 and includes both volatile and non-volatile media, removable and non-removable media. By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer storage media includes both volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by computer 110. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of any of the above should also be included within the scope of computer readable media.
The system memory 130 includes computer storage media in the form of volatile and/or non-volatile memory such as ROM 131 and RAM 132. A basic input/output system 133 (BIOS), containing the basic routines that help to transfer information between elements within computer 110, such as during start-up, is typically stored in ROM 131. RAM 132 typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit 120. By way of example, and not limitation,
The computer 110 may also include other removable/non-removable, volatile/non-volatile computer storage media. By way of example only,
The drives and their associated computer storage media, discussed above and illustrated in
The computer 110 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 180. The remote computer 180 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 110, although only a memory storage device 181 has been illustrated in
When used in a LAN networking environment, the computer 110 is connected to the LAN 171 through a network interface or adapter 170. When used in a WAN networking environment, the computer 110 typically includes a modem 172 or other means for establishing communications over the WAN 173, such as the Internet. The modem 172, which may be internal or external, may be connected to the system bus 121 via the user input interface 160, or other appropriate mechanism. In a networked environment, program modules depicted relative to the computer 110, or portions thereof, may be stored in the remote memory storage device. By way of example, and not limitation,
The present invention is directed to a system and method for using private keys in software development that minimizes the risks of the private key being lost or stolen. The present invention will be described with reference to the MICROSOFT .NET Framework and development tools such as VISUAL STUDIO, available from Microsoft Corporation, Redmond, Wash. It is noted, however, that the present invention is not limited to such platforms or development tools and may be used with other platforms and development tools known to those of ordinary skill in the art.
Strong names uniquely identify an assembly, allowing it to be placed in the Global Assembly Cache, and also implement the versioning system in the MICROSOFT .NET Framework common language runtime. A strong name consists of the assembly's identity, e.g., its simple text name, version number, and culture information (if provided), plus a public key and a digital signature. It is generated from an assembly file using the corresponding private key. Because the strong name is based on a digital signature generated with a private key, it provides security against spoofing attacks where a malicious piece of code attempts to masquerade as another assembly.
The present invention improves upon prior methods by persisting the private/public key pair in a password-encrypted file using a standard encryption format (e.g., Personal Information Exchange Syntax Standard PKCS #12 (PFX file)) that can be made available to everyone. Because the key pair is persisted as a file, it can then be managed using the same methods and tools used for managing source code files (e.g., project systems, build systems, source code control systems) rather than conventional cumbersome key management systems. The same methods and tools used to avoid loss of source code files (e.g., periodic hard drive backups) can be employed to prevent the loss of the private key file.
Before the subsystem of the development environment creates a new key pair to be used for assembly signing, a password is supplied so that the public/private key pair can be encrypted into the file. The password is provided by the developer at the time the key is created and immediately discarded once the file is encrypted. The system first creates the public and private key pair, creates a temporary in-memory X509 Certificate, assigns the generated key pair to the certificate, and exports the key pair to a PFX file. The contents of the PFX file are encrypted using the user-supplied password. The PFX file is then added to the user's project where it can be maintained along with the application source code files.
The first time any subsystem of the development environment requires use of the private key contained in an encrypted file format, the subsystem computes the hash of the PFX file and attempts to use a key container in the local cryptographic store (e.g., the CryptoDB in the MICROSOFT WINDOWS operating system) having a name that matches that hash. If no such key container exists, the developer is prompted to provide the password to decrypt the key. The user supplies the password and the PFX file is decrypted and imported into a temporary in-memory X509 certificate. The public/private key pair is then extracted from certificate and imported into a non-exportable key container in the local cryptographic store named based on a hash of the encrypted key file. It is preferable that the key pair is imported into the CryptoDB as non-exportable to further protect the key contents.
Subsequent attempts to use the key from that users account on that machine are then automatically directed to the named container so that the key can be used without requiring the developer to re-enter the password. When signing with an encrypted key file, the system first computes the hash of the file and checks if the key container named after the hash exists in the default RSA CSP. If so, the signing continues using the specified key container name. During signing, the key pair contents of the encrypted key file are not used, only the installed key pair in the Crypto database. The invention thereby enables a single developer or a team of developers to easily and safely share a private key across different computers and user accounts without the inconvenience of being repeatedly prompted for a password.
The present invention uses established APIs for generating key pairs, creating certificates, exporting certificates to PFX files, importing PFX files to certificates, and importing key pairs to the cryptographic store. The present invention advantageously uses the PFX standard, which means that the encrypted key file is interoperable with existing infrastructure for storing keys and certificates, as well as signing code. For example, the PFX file can be used with command line tools such as sn.exe, a code signing utility provided by the MICROSOFT .NET Framework, or signcode.exe another code signing utility supported by the WINDOWS operating system. The PFX file could also be imported into the WINDOWS Certificate Store, where it can be accessed and used through established WINDOWS APIs. The certificate can also be imported into the WINDOWS Trusted Publishers list in order to establish policy trusting applications signed with the certificate.
Referring now to
Pressing the Assembly Information button launches the dialog show in
Referring again to
If the developer chooses the <new> . . . option under the “Use a key file” entry, they can create a new key using the dialog of
The option “Use a key provider” allows the developer to sign using a key from a container in the local crypto database. This allows the developer to sign using key management devices such as smart cards and lockboxes that expose their keys through the standard crypto APIs. The provider dropdown enumerates all of the providers on the local machine. The name dropdown enumerates all of the container names within the provider.
The option “Delay sign only” allows the developer to delay sign the assembly, in which case the selected key file or container need only contain the public portion of the key pair.
While the present invention has been described in connection with the preferred embodiments of the various Figs., it is to be understood that other similar embodiments may be used or modifications and additions may be made to the described embodiment for performing the same function of the present invention without deviating therefrom. For example, one skilled in the art will recognize that the present invention as described in the present application may apply to any computing device or environment, whether wired or wireless, and may be applied to any number of such computing devices connected via a communications network, and interacting across the network. Furthermore, it should be emphasized that a variety of computer platforms, including handheld device operating systems and other application specific operating systems are contemplated, especially as the number of wireless networked devices continues to proliferate. Still further, the present invention may be implemented in or across a plurality of processing chips or devices, and storage may similarly be effected across a plurality of devices. Therefore, the present invention should not be limited to any single embodiment, but rather should be construed in breadth and scope in accordance with the appended claims.
Number | Name | Date | Kind |
---|---|---|---|
5799086 | Sudia | Aug 1998 | A |
5825300 | Bathrick et al. | Oct 1998 | A |
5862325 | Reed et al. | Jan 1999 | A |
5892828 | Perlman | Apr 1999 | A |
5982898 | Hsu et al. | Nov 1999 | A |
6081893 | Grawrock et al. | Jun 2000 | A |
6192130 | Otway | Feb 2001 | B1 |
6260141 | Park | Jul 2001 | B1 |
6330677 | Madoukh | Dec 2001 | B1 |
6438690 | Patel et al. | Aug 2002 | B1 |
6460141 | Olden | Oct 2002 | B1 |
6694025 | Epstein et al. | Feb 2004 | B1 |
6704868 | Challener et al. | Mar 2004 | B1 |
6718468 | Challener et al. | Apr 2004 | B1 |
6772331 | Hind et al. | Aug 2004 | B1 |
6834112 | Brickell | Dec 2004 | B1 |
6898707 | Sit et al. | May 2005 | B1 |
6948070 | Ginter et al. | Sep 2005 | B1 |
7000108 | Yarsa et al. | Feb 2006 | B1 |
7120802 | Shear et al. | Oct 2006 | B2 |
7389536 | Challener et al. | Jun 2008 | B2 |
7395436 | Nemovicher | Jul 2008 | B1 |
7441277 | Burges et al. | Oct 2008 | B2 |
7602910 | Johansson et al. | Oct 2009 | B2 |
7925898 | Shear et al. | Apr 2011 | B2 |
7984488 | Cross et al. | Jul 2011 | B2 |
7996673 | Ivanov et al. | Aug 2011 | B2 |
20020023213 | Walker et al. | Feb 2002 | A1 |
20020042884 | Wu et al. | Apr 2002 | A1 |
20020071565 | Kurn et al. | Jun 2002 | A1 |
20020095454 | Reed et al. | Jul 2002 | A1 |
20020129261 | Cromer et al. | Sep 2002 | A1 |
20020133396 | Barnhart | Sep 2002 | A1 |
20020144109 | Benantar et al. | Oct 2002 | A1 |
20020144119 | Benantar | Oct 2002 | A1 |
20020150241 | Scheidt et al. | Oct 2002 | A1 |
20020172367 | Mulder et al. | Nov 2002 | A1 |
20030105965 | Challener | Jun 2003 | A1 |
20030123671 | He et al. | Jul 2003 | A1 |
20030154376 | Hwangbo | Aug 2003 | A1 |
20040030887 | Harrisville-Wolff et al. | Feb 2004 | A1 |
20040117662 | Ong et al. | Jun 2004 | A1 |
20040139309 | Gentil et al. | Jul 2004 | A1 |
20040260652 | Rose | Dec 2004 | A1 |
20040268152 | Xia et al. | Dec 2004 | A1 |
20050081026 | Thornton et al. | Apr 2005 | A1 |
20050086531 | Kenrich | Apr 2005 | A1 |
20050120203 | Yeh et al. | Jun 2005 | A1 |
20050257057 | Ivanov et al. | Nov 2005 | A1 |
20050267844 | Gallant et al. | Dec 2005 | A1 |
20070203957 | Desai et al. | Aug 2007 | A1 |
20090055642 | Myers et al. | Feb 2009 | A1 |
20110296172 | Fu et al. | Dec 2011 | A1 |
Number | Date | Country | |
---|---|---|---|
20060059350 A1 | Mar 2006 | US |