Sie sind auf Seite 1von 9

CR YPTOGRAPHY

Secure E-Commerce:
Understanding the
Public Key Cryptography
Jigsaw Puzzle
Viswanathan Kodaganallur, Ph.D.

oday almost all organizations use BASICS OF SECRET COMMUNICATIONS

T the Internet extensively for both


intra- and inter-organizational com-
munications. The Internet is also the exclu-
Perfectly secure communication is impossi-
ble in theory. It is always a possibility for
any message to fall into the wrong hands.
sive vehicle for E-commerce transactions The practical approach is to reduce the like-
involving customers and other business lihood of this happening to acceptably small
partners. This eliminates the significant levels. Nowadays encryption is the main
infrastructure costs of private data commu- approach to keeping communications
nications networks and enables even small secret. A message being communicated
companies to participate in E-commerce. (plaintext) is encrypted in such a way that
However, extensive use of public media for the encrypted message (ciphertext) can be
transferring sensitive data poses serious understood only if it is decrypted. Clearly,
security challenges. the message is secret only to the extent that
One of the main weapons in overcoming decrypting the ciphertext is difficult. A mes-
these challenges is public key cryptography. sage can be encrypted in several ways.
Although public key cryptography is exten- A procedure to encrypt a message is
sively used today, relatively few people called a cipher. A trivial (and not very
(managerial and technical) understand its secure) example of a cipher is one that
essence, preferring to leave that to the spe- reverses the characters in a message. The
cialists. Although the intricate technical recipient of the message, if aware of how
details are best left to the specialists, a solid the message has been encrypted, can
understanding of the broad picture is neces- decrypt it by reversing the characters in the
sary and well within the reach of everyone. ciphertext to recreate the plaintext.
This article sets out to convey just such an Another example is a substitution cipher,
understanding. which works by substituting each character

VISWANATHAN KODAGANALLUR, Ph.D., is an Associate Professor of Computing and Decision Sci-


ences at Seton Hall University's Stillman School of Business. He earned his Ph.D. in operations man-
agement from the Indian Institute of Management. Dr. Kodaganallur started his working career in
academia. He then switched to the software development industry where he spent a decade before
returning to academia in 2001. His research interests include information systems security, object-ori-
ented software development, intelligent tutoring systems, and combinatorial optimization.

44 I N F O R M A T I O N S Y S T E M S S E C U R I T Y
W W W . I N F O S E C T O D A Y . C O M
FIGURE 1 Encryption and Decryption with Key-Based Symmetric Ciphers

Shared key Shared key

plaintext Symmetric Symmetric


ciphertext
cipher cipher

Encryption Decryption

of the plaintext message with some other ever, with something called “key-based”
character. This can be decrypted via reverse ciphers, the ciphertext depends not only on
substitution by a recipient who is aware of the encryption procedure but also on a secret
what substitutions have been made. In this key used during the encryption process.
example, the cipher operates in conjunction For example, suppose the plaintext is
with a secret key (the substitution scheme). “6011 8767 3421 8875” (perhaps a credit
The same cipher used on the same plaintext card number). Let us suppose that some
with a different key will yield different specified method X is being used for
ciphertext. encryption. With the secret key
Single-character substitution ciphers can “7463562781,” the plaintext might get
be easily cracked by cryptanalysts (people encoded to “6bgs 8ys9 0ehw yhfk”;
who break ciphers) through techniques such whereas, using the same method X but a dif-
as frequency analysis. For example, the ferent secret key, the plaintext would be
most frequently occurring letters in English encoded to something completely different.
are “e,” “t,” and “a.” By counting the fre- To decrypt messages encrypted using key-
quency of each letter in the ciphertext, a
based ciphers, one needs to know not only
cryptanalyst can make a guess about which
the encoding procedure but also the secret
letters in the ciphertext probably map to
key value. Keeping the key hidden from all
these letters. Once these are established,
except the message recipient makes it very
other clues, such as which letters commonly
difficult for unauthorized parties to obtain
precede and follow these letters, can be used
the plaintext from the ciphertext, even if
to make further progress.
More powerful ciphers, called block they know what kind of cipher has been
ciphers, encode a block of text at a time used. This process is illustrated in Figure 1.
rather than just a single character. Under An example of a key-based block cipher
these, a block of text (say, 128 bits) is is DES (Data Encryption Standard), which
replaced with a different block of the same, was adopted as a standard by the U.S. gov-
or different, size. The number of possible ernment in 1977 and the financial industry
transformations increases rapidly with the in 1981. DES uses a 56-bit key. Today, DES
block size, consequently making cryptanal- is not considered safe enough primarily
ysis more difficult. because of its small key size. Computing
Although people can come up with many technology has become powerful enough
different methods of encoding, the need for for a cryptanalyst to exhaustively try all
standardization makes it necessary to adopt possible key combinations on a DES cipher-
one or a few methods universally. On the text within a reasonable amount of time and
face of it this would seem to defeat the very hence to decode DES ciphertext even with-
purpose of encrypted communication. How- out having the secret key.

C R Y P T O G R A P H Y 45
J A N U A R Y / F E B R U A R Y 2 0 0 6
Prominent among the new approaches media; after all, it is not practical to
are AES (supports key sizes of 128, 192, expect that all communicating parties
and 256 bits), Triple DES (overcomes the will meet in person to exchange keys.
limited key size by applying DES three Furthermore, to break a cipher, a cryptan-
times with two or three different keys), alyst needs a lot of ciphertext created
Rivest ciphers (RC2, RC4, RC5, and RC6), using a single key. Thus, to minimize the
and others such as IDEA (International Data risk of compromising secrecy, it would
Encryption Algorithm) and CAST. All the be necessary to periodically change the
ciphers mentioned above are called “sym- symmetric keys used. This requirement
metric key” ciphers because the same secret further complicates the task of secure key
key is used for encryption and decryption. distribution.
Symmetric key ciphers that are almost ■ Integrity: It should be possible for the
impossible to break are but one part of recipient to verify that the message was
secure E-commerce. Other issues must be not tampered with in transit. This is
addressed for secure communications in important because an attacker might
today’s world, where many parties need to intercept a message and insert a different
communicate over an insecure medium one in its place. A contemporary example
such as the Internet. Any scheme that is of this would be when a hacker intercepts
used must ideally meet all of the following a transmission from an E-commerce
requirements: server to a client and inserts the hacker’s
own Web page in place of the server’s
■ Confidentiality: It should be almost page. An unsuspecting user might then
impossible for anyone but the intended enter sensitive information on the
recipient to decipher the message. This is hacker’s page and submit it to the hacker.
the most obvious aspect of secure com- ■ Authentication: It should be possible for
munications and is well addressed by the a message recipient to verify the identity
symmetric key ciphers already men- of the message originator in order to avoid
tioned. dealing with an imposter. This is essential
■ Scalability: The approach should be con- because an imposter on the Web could eas-
venient to use when the number of com- ily pose as a genuine E-commerce vendor
municants and messages is large. Secret and steal sensitive information.
communication with symmetric keys is Another related issue is that of non-
not scalable when used in isolation. It repudiation; a sender of a message (such
runs into various problems when many as an important legal business document)
unacquainted parties need to communi- should not be able to later claim to have
cate secretly; as, for example, in E-com- never sent it. This goal is achieved once the
merce transactions. identity of the sender of a message can be
The biggest bottleneck with such sys- irrevocably established.
tems is the distribution and management
of the secret keys. Suppose there are n I will now discuss the pieces of the public
parties communicating with each other key cryptography jigsaw puzzle that address
and all communications need to be each of these issues. Table 1 summarizes the
secret; then each party has to keep track issues and the techniques that address each
of one secret key for each of the n–1 par- issue. Detailed descriptions of the tech-
ties with whom it needs to communicate. niques follow.
An even bigger problem is that of
safely distributing the keys in the first ASYMMETRIC KEY CIPHERS
place so that the secret keys do not fall We have already seen that key distribution
into the wrong hands. It should be possi- and management is a problem with symmet-
ble to exchange keys safely over insecure ric key ciphers. Whitfield Diffie and Martin

46 I N F O R M A T I O N S Y S T E M S S E C U R I T Y
W W W . I N F O S E C T O D A Y . C O M
TABLE 1 Issues in Public Key Cryptography

Issue Technique

Confidentiality Key-based ciphers (symmetric and asymmetric)


Scalability Asymmetric key ciphers, digital certificates, and Secure Sockets Layer
Integrity Message digests and digital signatures
Authentication Digital certificates and certificate authorities

Hellman of Stanford University made path- widely distributed because it does not mat-
breaking discoveries that gave birth to mod- ter who gets hold of it. Communication
ern cryptography. They demonstrated for using asymmetric key ciphers is called pub-
the first time that it is possible for commu- lic key cryptography.
nicating parties to exchange keys securely For a concrete illustration of how secure
over insecure media. They also suggested communication would work under this sys-
the concept of asymmetric key ciphers, tem, suppose person A wants to send a
wherein the keys used for encryption and secret message to person B, and A and B
decryption are different. already have each other’s public keys (they
Although they suggested the concept of could have exchanged them via e-mail, for
asymmetric key ciphers, they were unable example). Further, suppose that a hacker
to develop a concrete realization of the con- (H) is eager to listen in on this communica-
cept — an actual cipher that would work as tion. A would first encrypt her message
they suggested. That was later done by the
using B’s public key and send the ciphertext
MIT team of Ron Rivest, Adi Shamir, and
to B. On receiving the message, B can
Leonard Adleman, who created RSA, the
decrypt it using his private key. Even if H
first asymmetric key cipher. Another well-
sees the ciphertext, not possessing B’s pri-
known asymmetric key cipher is the ElGamal
vate key, H can do nothing useful with the
cipher.
The two keys of an asymmetric cipher data. This process is illustrated in Figure 2.
form a key pair, with one of them being the B can now reply to A by encrypting the
private key and the other the public key. A message with A’s public key, and the con-
key pair has the following properties: versation can proceed securely even though
H can potentially intercept each and every
■ A message encrypted with a public key byte of the transmissions.
can be decoded only with the matching Although this seems to be a foolproof
private key. In the case of reversible arrangement, this alone does not prevent H
asymmetric key ciphers, the converse from being malicious. H might be able to
also works — a message encrypted with intercept a message from A to B and replace
a private key can be decrypted only with it with his own message properly encrypted
the matching public key. with B’s public key (recall that B makes no
■ Given a public key, it is almost impossi- effort to hide his public key). On receiving
ble to figure out the matching private this message, B has no way of knowing that
key. By “almost impossible,” we mean
the integrity of the message has been com-
that, although it is theoretically possible
promised and that the message has really
to figure out the private key given only
been sent by an imposter acting as A.
the public key, in practice it would take
Although confidentiality has not been com-
several years of computing.
promised, there has been a security breach.
As the names imply, a private key is kept How can B be sure of the authenticity of the
completely private — no one but the owner sender of the message just by looking at the
knows this key — but the public key can be message?

C R Y P T O G R A P H Y 47
J A N U A R Y / F E B R U A R Y 2 0 0 6
FIGURE 2 Secret Communication with Public Keys and Asymmetric Ciphers

A’s computer B’s computer

B’s public key B’s private key

Asymmetric Asymmetric
plaintext cipher ciphertext cipher plaintext

FIGURE 3 Double Encryption Scheme with Public Key Cryptography

B’s public key A’s private key

plaintext Asymmetric Asymmetric


ciphertext 1
cipher cipher

B’s computer ciphertext

B’s private key A’s public key

Asymmetric Asymmetric
plaintext ciphertext 1
cipher cipher

There is a way by which confidentiality, ■ This approach provides confidentiality.


integrity, and authentication can all be H can decrypt using A’s public key and
achieved with asymmetric ciphers. Let us undo the effect of A’s private key; but the
assume as before that A and B have result is still ciphertext created with B’s
exchanged public keys. Now, when A wants public key that requires B’s private key to
to send a message to B, A first encrypts the decrypt. Not possessing B’s private key,
message using B’s public key and then H can go no further.
encrypts the resulting ciphertext once again ■ This approach preserves integrity. The
using her own private key and sends the second step in the decryption process by
resultant doubly encrypted message to B. B B is to use A’s public key. This can work
first uses A’s public key and, on the result, only on a message encrypted with A’s
uses his own private key to get back the private key. Not having A’s private key,
original message. Figure 3 illustrates this H cannot insert anything that will decrypt
process. properly with A’s public key.

48 I N F O R M A T I O N S Y S T E M S S E C U R I T Y
W W W . I N F O S E C T O D A Y . C O M
■ This approach provides authentication. has the property that if even a single bit of
When B uses A’s public key followed by the input message is changed, the digest cal-
his own private key and gets anything culated will have a different value. Further,
meaningful, it is clear that the message it is almost impossible to intentionally con-
was actually sent by A. No one other than struct two messages that have the same
A could have sent anything that could be digest value.
decrypted meaningfully with A’s public For the moment, assume that we are con-
key. cerned only about integrity and that there is
no requirement for confidentiality. (I will
Although this seems to be a complete
bring confidentiality back into the equation
solution, it leaves open two problems:
later.) In such a case, when A sends a mes-
■ Encryption and decryption with asym- sage to B, A can send the message along
metric key ciphers are extremely com- with its calculated digest value. On receiv-
puting intensive. The operations are ing the message, B re-computes the digest
slower by a factor of 100 when compared value and compares it to the value sent by A.
with symmetric key ciphers. Thus, the If the two match, B can be confident that the
above scenario is actually impractical message was not changed in any way in
from a computing-time perspective. transit; if the message was modified, the two
Asymmetric key ciphers are therefore message digest values would not match.
seldom used for entire communications It is easy to see that message digests
unless the amount of data being alone are insufficient to thwart a hacker.
encrypted is very small. We will see later After all, the hacker can interpose and
in the article that they are generally used replace the message with a new one and also
only to exchange public keys spontane- replace the digest with the digest corre-
ously when needed, and to use these keys sponding to the new message. Thus, the recip-
to agree on a symmetric session key. The ient will find that the digests match even
session key is then used for the rest of the though the message has lost its integrity.
session with a symmetric key cipher. Digital signatures use the concept of
■ Communicating parties would need to message digests with an added twist based
manage large numbers of public keys, on asymmetric keys to completely thwart
and if two unacquainted parties needed to
hackers from surreptitiously modifying a
communicate they would have to go
message in transit. Once again we assume
through the ritual of public key exchange
that our only concern is integrity. Using dig-
first — but how do they trust each other
ital signatures, when A sends a message to
in the first place? Digital certificates and
B, A first calculates the message digest. A
certificate authorities, discussed later,
then encrypts the message digest with her
address this issue.
private key. The result is the digital signa-
Although the method of double encryp- ture of the message. A now sends the origi-
tion of the message does solve the integrity nal plaintext message along with its digital
problem, we have seen that it is not practi- signature to B. Because the message digest
cal. A practical approach is based on digital is only a simple number, using asymmetric
signatures. key ciphers on it is not computationally
intensive.
DIGITAL SIGNATURES On receiving the message, B first uses
To explain how digital signatures work, I A’s public key to decrypt the digital signa-
first need to introduce the concept of mes- ture. This provides B with the message
sage digests. A message digest is a simple digest value. B can then independently gen-
number that can be quickly calculated from erate the message digest from the plaintext
an input message. A good message digest message and compare the two. If they

C R Y P T O G R A P H Y 49
J A N U A R Y / F E B R U A R Y 2 0 0 6
FIGURE 4 Creating and Verifying Digital Signatures

A’s private key

Digest message Asymmetric digital


plaintext Algorithm cipher
digest signature

B’s computer

A’s public key

digital Asymmetric message If the two digests


signature cipher digest 1 match then B
knows that the
message is genuine
Digest message
plaintext
Algorithm digest 2

match, then B is confident that no one has digital certificates and certificate authorities
tampered with the message. This process is come into the picture.
illustrated in Figure 4.
Under this scenario, it is impossible for DIGITAL CERTIFICATES
the hacker (H) to undetectably replace the As before, let us assume that A and B have
transmission with a new message and a already exchanged public keys and trust
matching digital signature because H does each other. Suppose C now wants to have a
not have A’s private key. Suppose H does secure communication with A, but A and C
replace the message with a new message are not mutually acquainted. Unless A
and replaces the digital signature with one knows or trusts C, A will refuse to have a
generated using his own private key and secure conversation with C. Suppose B
then sends the message and the signature to knows and trusts C. Now, because A trusts
B. B, assuming that the message is coming B and B trusts C, there is a chain of trust
from A, will use A’s public key on the digi- potentially enabling A to trust C. How is
tal signature. This will fail to produce the this chain of trust established electroni-
actual message digest that H calculated cally? Because B trusts C, B can issue a dig-
because H did not use A’s private key. B ital certificate to C. A digital certificate
will thus know that someone has tampered consists of identifying information about an
with the message. entity along with the signed public key of
Digital signatures do not address the con- that entity. It essentially states that the issuer
fidentiality issue at all. They do solve the of the certificate believes that the public key
integrity problem completely. To a limited in the certificate belongs to the person
extent, they also solve the problem of whose identifying information appears in
authentication, if the message recipient has the certificate.
the public key of the sender. In real terms it To issue a digital certificate to C, B cre-
is impractical to expect that any two com- ates a structure that contains identifying
municants will have each other’s public information about C (e.g., the name and
keys readily available at all times. We need other important public information) and
a scalable way of exchanging public keys attaches C’s public key encrypted with the
spontaneously with a guarantee of the iden- private key of B. Because B is the only entity
tities of the parties involved. This is where that can use B’s private key, the certificate

50 I N F O R M A T I O N S Y S T E M S S E C U R I T Y
W W W . I N F O S E C T O D A Y . C O M
FIGURE 5 B Creating a Digital Certificate for C

B’s private key

Digest message Asymmetric


Algorithm digest cipher

Information about B
Information about C digital
C’s public key signature

C’s digital
certificate

essentially represents that B vouches for C’s pre-installed with these public keys. Sup-
identity, and anyone having B’s public key pose two parties A and C are unacquainted
can verify the fact. This process is illus- and one of them, say C, wishes to initiate a
trated in Figure 5. secure conversation with the other. C first
The above arrangement works fine when gets a digital certificate from a CA and pre-
there is an intermediary such as B who can sents it to A. A already has the public key of
establish a chain of trust between the com- well-known CAs and hence can use the
municating parties. In most business situa- appropriate one to extract C’s public key
tions, especially in Web-based business-to- from the certificate. Similarly, A can
consumer E-commerce, this requirement present her certificate to C, from which C
would be cumbersome. This issue is can get A’s public key. The above mecha-
addressed by certificate authorities. nism can be employed to spontaneously
exchange public keys with complete confi-
CERTIFICATE AUTHORITIES dence about the identities of the communi-
Certificate authorities (CAs) are organiza- cating parties.
tions specifically created to issue digital cer- However, as already mentioned, using
tificates after properly verifying the public key encryption is computing inten-
identities of entities requesting them. Many sive and impractical for complete conversa-
CAs exist; some well-known ones are Veri- tions. This final hurdle is addressed by
sign, Certisign, and Thawte. CAs are Secure Sockets Layer.
assumed to be trusted parties and hence the
certificates issued by them serve to verify SECURE SOCKETS LAYER
the identities of the parties presenting them. Secure Sockets Layer (SSL) was created by
For example, in a Web-based E-commerce Netscape Corporation to address the diffi-
transaction, a buyer would want to ensure culty of using public key encryption for
that she is really dealing with a genuine Web complete conversations. It provides a way
site and not that of an imposter before enter- to use a symmetric key cipher (much more
ing sensitive information such as a credit card efficient than asymmetric key ciphers) in a
number. The vendor can establish identity by secure manner. It is specifically designed
presenting a digital certificate issued by a for Web-based E-commerce wherein a
CA. browser and server need to engage in a
The public keys of CAs are widely dis- secure conversation. The following steps
tributed. All Web browsers typically come occur in an SSL-based exchange:

C R Y P T O G R A P H Y 51
J A N U A R Y / F E B R U A R Y 2 0 0 6
■ The server presents a digital certificate and therefore the full weight of public key
issued by a CA. cryptography, is in use.
■ The browser verifies the certificate and
extracts the server’s public key. CONCLUSIONS
■ The browser then generates a symmetric This article has introduced the essential
key (called session key). aspects of public key cryptography. We
■ The browser encrypts the session key looked at the shortcomings of symmetric
with the server’s public key and sends it
key ciphers used in isolation and showed
to the server.
how public key cryptography based on
■ The server extracts the session key.
asymmetric key ciphers overcomes the
■ The browser and server conduct a secret
problems by enabling confidentiality, mes-
conversation using the shared session
key, but they can use a symmetric key sage integrity, and authentication. Finally,
cipher for much greater efficiency. we looked at the essentials of SSL, which
■ Server and browser discard the session combines the power of public key cryptog-
key at the end of the conversation. raphy with the speed of symmetric key
ciphers to provide security and effi-
In the above scenario, only the server is ciency.
authenticated by means of a digital certifi-
cate; this is all that is typically needed for References
business-to-consumer E-commerce. A ver- 1. Harold F. Tipton (Editor), Micki Krause (Editor),
sion of SSL includes client authentication as Information Security Management Handbook,
well, which can be used when both parties Fifth Edition, Auerbach Publications, 2004.
need to be authenticated. 2. Charlie Kaufman, Radia Perlman, Mike Speciner,
Network Security: Private Communication in a
When we see “https://——” in our Public World, Second Edition, Prentice Hall,
browser’s address line, it indicates that SSL, 2002.

52 I N F O R M A T I O N S Y S T E M S S E C U R I T Y
W W W . I N F O S E C T O D A Y . C O M

Das könnte Ihnen auch gefallen