# Patent

## Title
System and method for digitally signing electronic documents

## Abstract

A system for digitally signing electronic documents is disclosed. The system includes a mobile device, an application server and a database, the mobile device includes a requesting module and a digest encrypting module, the application server includes an obtaining module, a digest generating module and a merging module. The requesting module is configured for sending a request for a digital signature of an electronic document to the application server; the obtaining module is configured for obtaining the electronic document from the database; the digest generating module is configured for generating a digest of the electronic document, and sending the digest to the mobile device; the digest encrypting module is configured for encrypting the digest, generating an encrypted value, and sending the encrypted value to the application server; the merging module is configured for merging the encrypted value and the electronic document. A related computer-based method is also disclosed.

## Background
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention is related to a system and method for digitally signing electronic documents.
2. Description of Related Art
The digital signature uses a hash algorithm and a public key cryptogram algorithm to encrypt and decrypt electronic documents. The hash algorithm (such as SHA1) is used for transforming the electronic document into a fixed-length character string that is usually 128 bit, 160 bit, 256 bit, and 512 bit, in order to shorten the length of the digital signature and improve the digital signature efficiency.
The public key cryptogram algorithm (such as RSA and ECC), also known as asymmetry algorithm, is used for encrypting and decrypting electronic documents with different keys (a public key and a private key). The public key is used for verifying the identity of a signer when the signer receives the digital signature. The private key is kept hidden and is used for the digital signature. A digital certificate includes a public key, a private key, signer information, and so on, which are issued by an authoritative third-party organization. Typically, electronic documents are signed digitally using a desktop computer or a notebook.
Therefore, what is needed is a system and method for digitally signing electronic documents which can digitally sign electronic documents using a mobile device such as a mobile phone.
SUMMARY OF THE INVENTION
A system for digitally signing electronic documents is provided in accordance with a preferred embodiment. The system includes a mobile device, an application server, and a database. The application server connects to the mobile device and the database. The database is configured for storing electronic documents to be signed digitally. The mobile device stores a digital certificate of a signer, the digital certificate includes a private key. The mobile device includes a requesting module and a digest encrypting module. The application server comprising an obtaining module, a digest generating module and a merging module. The requesting module is configured for sending a request for a digital signature of an electronic document to the application server. The obtaining module is configured for obtaining the electronic document from the database according to the request. The digest generating module is configured for generating a digest of the electronic document using a hash algorithm, and sending the digest of the electronic document to the mobile device. The digest encrypting module is configured for encrypting the digest of the electronic document with the private key using a public key cryptogram algorithm thereby generating a first encrypted value, and sending the first encrypted value to the application server. The merging module is configured for merging the electronic document and the first encrypted value according to the PKCS#7. The digest generating module is further configured for generating a digest of the merged document using the hash algorithm, and sending the digest of the merged document to the mobile device. The digest encrypting module is further configured for encrypting the digest of the merged document with the private key using the public key cryptogram algorithm thereby generating a second encrypted value, and sending the second encrypted value to the application server. The merging module is further configured for merging the first encrypted value, the second encrypted value and the electronic document according to the PKCS#7 thereby generating a digitally-signed electronic document.
A computer-based method for digitally signing electronic documents is also provided. The method includes the steps of: sending a request for a digital signature of an electronic document to an application server through a mobile device, the mobile device storing a digital certificate of a signer, the digital certificate including a private key; obtaining the electronic document by the application server from a database according to the request, generating a digest of the electronic document using a hash algorithm, and sending the digest of the electronic document to the mobile device; encrypting the digest of the electronic document with the private key using a public key cryptogram algorithm through the mobile device thereby generating a first encrypted value, and sending the first encrypted value to the application server; merging the electronic document and the first encrypted value according to the PKCS#7 through the application server, generating a digest of the merged document using the hash algorithm, and sending the digest of the merged document to the mobile device; encrypting the digest of the merged document with the private key using the public key cryptogram algorithm through the mobile device thereby generating a second encrypted value, and sending the second encrypted value to the application server; merging the first encrypted value, the second encrypted value and the electronic document according to the PKCS#7 through the application server thereby generating a digitally-signed electronic document.
Other systems, methods, features, and advantages of the present invention will become apparent to one with skill in the art upon examination of the following drawings and detailed description.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic diagram of hardware configuration of a system for digitally signing electronic documents in accordance with a preferred embodiment;
FIG. 2 is a schematic diagram showing function modules of the system of FIG.1; and
FIG. 3 is a flowchart of a preferred method for digitally signing electronic documents in accordance with one embodiment.



DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a schematic diagram of hardware configuration of a system for digitally signing electronic documents (hereinafter, “the system”) in accordance with a preferred embodiment. The system typically includes a mobile device 10, an application server 20, and a database 30. The application server 20 connects with the mobile device 10 and the database 30. The mobile device 10 may connect to the application server 20 through the Bluetooth technology. The mobile device 10 can be a mobile phone, a personal digital assistant (PDA) or any other suitable electronic device. The database 30 is configured for storing electronic documents to be signed digitally.
FIG. 2 is a schematic diagram showing function modules of the system of FIG. 1. The mobile device 10 may include a requesting module 110 and a digest encrypting module 111. The application server 20 may include an obtaining module 210, a digest generating module 211, a merging module 212, and a saving module 213.
The requesting module 110 is configured for sending a request for a digital signature of an electronic document to the application server 20 when a signer selects the electronic document to be signed digitally through the mobile device 10. The mobile device 10 stores a digital certificate of the signer. The digital certificate may include personal information of the signer, a private key for encrypting the electronic document, and a period of validity of the digital certificate.
The obtaining module 210 is configured for obtaining the electronic document from the database 30 according to the request. The digest generating module 211 is configured for generating a digest of the electronic document using a hash algorithm such as the Secure Hash Algorithm 1 (SHA1), and sending the digest of the electronic document to the mobile device 10.
The digest encrypting module 111 is configured for encrypting the digest of the electronic document with the private key using a public key cryptogram algorithm such as the RSA algorithm thereby generating a first encrypted value, and sending the first encrypted value to the application server 20. The letters RSA are the initials of surnames of Ron Rivest, Adi Shamir, and Len Adleman.
The merging module 212 is configured for merging the electronic document and the first encrypted value according to the PKCS#7 (Cryptographic Message Syntax Standard). The PKCS refers to a group of Public Key Cryptography Standards.
The digest generating module 211 is further configured for generating a digest of the merged document using the hash algorithm such as the secure hash algorithm 1 (SHA1), and sending the digest of the merged document to the mobile device 10.
The digest encrypting module 111 is further configured for encrypting the digest of the merged document with the private key using the public key cryptogram algorithm such as the RSA algorithm thereby generating a second encrypted value, and sending the second encrypted value to the application server 20.
The merging module 212 is further configured for merging the first encrypted value, the second encrypted value, and the electronic document according to the PKCS#7 thereby generating a digitally-signed electronic document, and saving the digitally-signed electronic document in the database 30.
FIG. 3 is a flowchart of a preferred method for digitally signing electronic documents in accordance with one embodiment. In step S401, the requesting module 110 sends a request for a digital signature of an electronic document to the application server 20 when a signer selects the electronic document to be signed digitally through the mobile device 10. The mobile device 10 stores a digital certificate of the signer. The digital certificate may include personal information of the signer, a private key for encrypting the electronic document, and a period of validity of the digital certificate.
In step S402, the obtaining module 210 obtains the electronic document from the database 30 when the application server 20 receives the request. Then, the digest generating module 211 generates a digest of the electronic document using a hash algorithm such as the Secure Hash Algorithm 1 (SHA1), and sends the digest of the electronic document to the mobile device 10.
In step S403, the digest encrypting module 111 encrypts the digest of the electronic document with the private key using the public key cryptogram algorithm such as the RSA algorithm thereby generating a first encrypted value, and sends the first encrypted value to the application server 20.
In step S404, the merging module 212 merges the electronic document and the first encrypted value according to the PKCS#7 (Cryptographic Message Syntax Standard). Then, the digest generating module 211 generates a digest of the merged document using the hash algorithm such as the secure hash algorithm 1 (SHA1), and sends the digest of the merged document to the mobile device 10.
In step S405, the digest encrypting module 111 encrypts the digest of the merged document with the private key using the public key cryptogram algorithm such as the RSA algorithm thereby generating a second encrypted value, and sends the second encrypted value to the application server 20.
In step S406, the merging module 212 merges the first encrypted value, the second encrypted value and the electronic document according to the PKCS#7 thereby generating a digitally-signed electronic document, and saves the digitally-signed electronic document in the database 30.
It should be emphasized that the above-described embodiments of the present invention, particularly, any preferred embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the invention. Many variations and modifications may be made to the above-described embodiment(s) of the invention without departing substantially from the spirit and principles of the invention. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present invention and protected by the following claims.

## Claims

1. A system for digitally signing electronic documents, the system comprising a mobile device, an application server, and a database, the application server being connected to the mobile device and the database, the database being configured for storing electronic documents to be signed digitally, the mobile device storing a digital certificate of a signer, the digital certificate comprising a private key, the mobile device comprising a requesting module and a digest encrypting module, the application server comprising an obtaining module, a digest generating module and a merging module, wherein:
the requesting module is configured for sending a request for a digital signature of an electronic document to the application server;
the obtaining module is configured for obtaining the electronic document from the database according to the request;
the digest generating module is configured for generating a digest of the electronic document using a hash algorithm, and sending the digest of the electronic document to the mobile device;
the digest encrypting module is configured for encrypting the digest of the electronic document with the private key using a public key cryptogram algorithm thereby generating a first encrypted value, and sending the first encrypted value to the application server;
the merging module is configured for merging the electronic document and the first encrypted value according to the PKCS #7 standard;
the digest generating module is further configured for generating a digest of the merged document using the hash algorithm, and sending the digest of the merged document to the mobile device;
the digest encrypting module is further configured for encrypting the digest of the merged document with the private key using the public key cryptogram algorithm thereby generating a second encrypted value, and sending the second encrypted value to the application server; and
the merging module is further configured for merging the first encrypted value, the second encrypted value and the electronic document according to the PKCS #7 standard thereby generating a digitally-signed electronic document.

2. The system according to claim 1, wherein the hash algorithm is the Secure Hash Algorithm 1 (SHA1).

3. The system according to claim 2, wherein the public key cryptogram algorithm is the RSA algorithm.

4. A computer-based method for digitally signing electronic documents, the method comprising:
sending a request for a digital signature of an electronic document to an application server through a mobile device, the mobile device storing a digital certificate of a signer, the digital certificate including a private key;
obtaining the electronic document by the application server from a database according to the request, generating a digest of the electronic document using a hash algorithm, and sending the digest of the electronic document to the mobile device;
encrypting the digest of the electronic document with the private key using a public key cryptogram algorithm through the mobile device thereby generating a first encrypted value, and sending the first encrypted value to the application server;
merging the electronic document and the first encrypted value according to the PKCS #7 standard through the application server, generating a digest of the merged document using the hash algorithm, and sending the digest of the merged document to the mobile device;
encrypting the digest of the merged document with the private key using the public key cryptogram algorithm through the mobile device thereby generating a second encrypted value, and sending the second encrypted value to the application server; and
merging the first encrypted value, the second encrypted value and the electronic document according to the PKCS #7 standard through the application server thereby generating a digitally-signed electronic document.

5. The method according to claim 4, wherein the hash algorithm is the Secure Hash Algorithm 1 (SHA1).

6. The method according to claim 4, wherein the public key cryptogram algorithm is the RSA algorithm.

7. A method for digitally signing electronic documents using an application server, the method comprising:
receiving a request for a digital signature of an electronic document sent from a mobile device to the application server;
obtaining the electronic document by the application server from a database according to the request, generating a digest of the electronic document using a hash algorithm, and sending the digest of the electronic document to the mobile device;
receiving a first encrypted value from the mobile device, the first encrypted value being obtained by encrypting the digest of the electronic document;
merging the electronic document and the first encrypted value according to the PKCS #7 standard through the application server, generating a digest of the merged document using the hash algorithm, and sending the digest of the merged document to the mobile device;
receiving a second encrypted value from the mobile device, the second encrypted value being obtained by encrypting the digest of the merged document; and
merging the first encrypted value, the second encrypted value and the electronic document according to the PKCS #7 standard through the application server thereby generating a digitally-signed electronic document.

8. A method for digitally signing electronic documents using a mobile device, the method comprising:
sending a request for a digital signature of an electronic document to an application server through the mobile device, the mobile device storing a digital certificate of a signer, the digital certificate including a private key;
receiving a digest of the electronic document sent from the application server;
encrypting the digest of the electronic document with the private key using a public key cryptogram algorithm through the mobile device thereby generating a first encrypted value, and sending the first encrypted value to the application server;
receiving a digest of a merged document sent from the application server, the merged document being obtained by merging the electronic document and the first encrypted value; and
encrypting the digest of the merged document with the private key using the public key cryptogram algorithm through the mobile device thereby generating a second encrypted value, and sending the second encrypted value to the application server for merging with the first encrypted value and the electronic document thereby generating a digitally-signed electronic document.