Context
Data passes between an online application and a Web service,
sometimes through one or more intermediaries. Messages may also be kept in
repositories, such as message queues or databases. Some of the data within the
messages is considered to be sensitive in nature. There is a risk that an
attacker can gain access to sensitive data, either by eavesdropping on the
network or accessing a repository.
Problem
How do you protect data within a message from information
disclosure to unintended parties?
Forces
Solution
Use encryption to protect sensitive data contained in a message.
Unencrypted data, known as plaintext, is converted to encrypted data, known as
ciphertext. Encryption occurs using an algorithm and cryptographic key.
Ciphertext is then converted back to plaintext at its destination.
Participants
Process
Applying data confidentiality can be broken into two steps:
1. Encrypting
the data –Plaintext is rendered unintelligible to parties other than the
intended recipient when the sender converts it into ciphertext.
2. Decrypting
the data –Ciphertext is rendered intelligible to the intended recipient by
converting it back into plaintext.
Two types of cryptography can be used to provide Data
Confidentiality - Symmetric and Asymmetric. While both symmetric and asymmetric
cryptography follow the same basic process, they each have their own unique
characteristics.
Symmetric Cryptography
With symmetric cryptography, both the sender and recipient share a
key that is used to perform both encryption and decryption. Symmetric
cryptography is commonly used to perform encryption, and to provide data
integrity.
Figure 1 shows the process of encrypting and decrypting data with a
shared secret key:
Figure 1
The Process of Symmetric Encryption
1. Sender creates ciphertext message by encrypting the plaintext message using a symmetric encryption algorithm and a shared key.
2. Sender sends ciphertext message to recipient.
3. Recipient decrypts ciphertext message back into plaintext with shared key.
There are numerous symmetric algorithms in use. Some
of the more common algorithms are RC5, RC6, Rijndael (AES), and Triple DES
(3DES). These algorithms are all designed to perform efficiently on common
hardware architectures.
Symmetric cryptography is comparatively simple in nature, because
the secret key used for both encryption and decryption is shared between the
sender and the recipient. However, before communication can occur, the sender
and recipient must exchange a shared secret key. In some cases (such as SSL),
asymmetric cryptography may be used to ensure that they initial key exchange
occurs over a secure channel.
Asymmetric Cryptography
With Asymmetric cryptography (also known as Public Key
cryptography) the sender encrypts data with one key, and recipient uses a
different key to decrypt ciphertext. The encryption key and its matching
decryption key are often referred to as a public/private key pair. As well as
providing encryption, Public Key cryptography is commonly used to provide
digital signatures, facilitating non-repudiation, and for key management
purposes.
The public key of the recipient is used to encrypt data. It can be
openly distributed to those wishing to encrypt a message to the recipient. The
private key of the recipient is used to decrypt messages, and only the
recipient must be able to access it.
Figure 2 demonstrates how asymmetric encryption and decryption take
place:
Figure 2
The Process of Asymmetric Encryption
1.
Sender creates ciphertext message by encrypting the plaintext
message using an asymmetric encryption algorithm and the recipients public key
2.
Sender sends ciphertext message to recipient
3.
Recipient decrypts ciphertext message back into plaintext
using the private key matched with the public key that was used to encrypt the
message
There are few asymmetric algorithms in use. The
most commonly used asymmetric algorithm is the RSA algorithm.
Asymmetric encryption requires more processing resources than
Symmetric encryption. For this reason, asymmetric encryption is often used to
exchange a shared key, which is then used for symmetric encryption. This is
particularly useful when a sender and recipient need to send multiple messages
back and forth within the same session.
Example
A Web service is published by a bank to provide business customers
with the ability to upload payroll account transfers.
Direct deposit account information is considered very sensitive for both
the business customer, as compromise of this information could result in
unauthorized account activity or disclosure of employee salary information.
Resulting Context
The following benefits, liabilities and security considerations are
associated with the use of Data Confidentiality.
Benefits
Preventing unauthorized parties from viewing messages can prevent
financial loss and legal liability, due to disclosure of sensitive information.
Liabilities
Security Considerations
Related Patterns
There are three different types of patterns associated with Data
Confidentiality: child patterns, dependent patterns, and alternate patterns.
Child Patterns
References
Acknowledgments
Improving
Web Application Security: Threats & Countermeasures - Chapter 2 athttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMCh02.asp?frame=true
Microsoft Confidential. © 2005 Microsoft Corporation.
All rights reserved. By using or providing feedback on these materials, you
agree to the attached license agreement.