Practical Use of Asymmetric Cryptography: Key distribution Authentication and Digital signatures

written by: Hazrul Aaron; article published: year 2007, month 05;


In: Categories » Electronics and communication » Network security » Practical Use of Asymmetric Cryptography: Key distribution Authentication and Digital signatures

The basic idea of using asymmetric cryptography is distributing public keys while keeping the private keys private and using a person's public key to encrypt data sent to this particular individual. This is defined as secure message format. The distribution of public keys can be done in a hierarchical manner (using X.509 certificates) or as a "brotherhood of the ring," establishing the ring of users who share each others' public keys. The last model is used by free privacy-protection software such as PGP and GnuPG. Public key infrastructure (PKI) can be deployed, so that anyone interested can download public keys from the centralized server instead of asking the receiving sides to send them. Such servers can be public (e.g., blackhole.pca.dfn.de and horowitz.surfnet.nl) or privately deployed by your company or organization.

Although the secure message format addresses data confidentiality, it does not provide authentication. This creates a well-documented vulnerability to man-in-the-middle attacks, when an attacker placed between both sides replaces public keys exchanged with his or her own public key. Thus, the attacker can decrypt the data coming from both ends with his or her own private key and forward it to some guy named Bill. At the same time, the attacker can encrypt the decrypted data with public keys of the victims and forward it to its intended destinations. Thus, the attack is completely transparent and the victims would not even suspect that their data has been snooped on. To avoid having Bill read your supposedly secret e-mails, some form of authentication is necessary. That can be done by reversing the process and encrypting the data with your private key. In such a case, anyone with your public key can decrypt and read the data, knowing that the data comes from you and no one else if it was decrypted successfully. This is defined as open message format. Open message format provides nonrepudiation service: An entity is bound to the pair of keys and cannot deny itself as a source of the data sent. The only claim the sending side can make is that the data was modified on the way to the destination. However, we know the method to prove (or disprove) such a claim: one-way hashes. Thus, we can take a one-way hash of the data and encrypt it with the public key before sending it. This is how digital signatures work, providing both nonrepudiation and data integrity services.

Digital signatures carry as much legal weight as conventional signatures, if not more, although the law in your country might be different on this issue; conventional signatures are much easier to forge. To forge a digital signature, the fraudsters must have root-level access to the server that stores the organization's private keys. Thus, such servers must use a stable, secure OS and undergo regular security audits. In some operational systems, commands exist that make the file immutable and undeletable (e.g., chattr +i in Linux). Applying such commands to the private key and then deleting the command binary from the system can confuse some attackers who manage to gain access to the system. It is a good idea to place the private-keys-storing host on a different subnet and implement fascist router access lists, restricting access to the server on a strict "need-to-know" basis. In higher security settings, private keys can be stored on a PDA or laptop kept offline in a durable safe and turned on only when enciphering and signing are necessary. Of course, a removable hard drive or Zip drive or read-only CD can be used for private keys instead of the whole machine; the choice of protection method is yours. Do not forget that the human factor is the weakest link, and only trusted personnel should have access to your private keys. The rest of the employees should not even know how and where the keys are stored.

There are two common digital signature algorithms in use: Digital Signature Algorithm (DSA) and the RSA Signature Scheme. The RSA Signature Scheme is founded on the RSA asymmetric cryptosystem and uses MD5 or SHA-1 for one-way hash generation. It was a de facto standard in digital signature generation and verification before the U.S. government introduced DSA. DSA is based on the ElGamal asymmetric cryptosystem and employs SHA-1. A more secure variety of DSA is the Elliptic Curve DSA (ECDSA). Although (provided the key size is 2,048 bits or higher) both RSA and DSA offer a sufficient level of security, the speed of operations involving both algorithms is different. RSA works much slower when operations involve the private key; the opposite is true for the DSA. Thus, DSA is far more efficient when it comes to signature generation and signing (server side), and RSA is more appropriate for signature verification (client side).

As you probably already realized, although digital signatures provide nonrepudiation and data integrity, no data confidentiality is supplied. A solution for this problem is secure and signed format:

  1. Generate a message digest of the data.

  2. Encrypt both data and hash with the private key.

  3. Encrypt the result with the receiver's public key.

Make sure that:

  • The keys are long enough, sufficiently random, and use the full keyspace spectrum.

  • Their storage and transmission are secure.

  • Key lifetime corresponds to the data sensitivity level.

A secure key backup solution can be both a difficult task and a hard decision to make. We leave it to you, because the key backup saves you from the unfortunate consequences of key loss, but introduces an additional target for private key-hungry intruders.

The question is this: If there is a secure and signed asymmetric cryptography format, why do we still have to use symmetric ciphers?

There are two answers: performance and key size. If the throughput of symmetric ciphers is estimated in megabytes per second, throughput of asymmetric ones is counted in kilobytes per second. The speed of RSA encryption (1,024-bit key) is about 1,500 times slower than the speed of enciphering with any of the five AES finalists. Such performance can introduce unacceptable delays in host and network operation, in particular when wireless networking is involved. Also, even the smallest acceptable 1,024-bit asymmetric cipher keys can be a problem for limited-resource devices like smart cards or mobile phones. Thus, a compromise between asymmetric cryptography secure key exchange and nonrepudiation properties and the performance of symmetric ciphers has to be found. Such a compromise exists in the form of hybrid encryption or digital envelopes:

  • Asymmetric keys are used for symmetric key distribution.

  • Symmetric keys are used for bulk data encryption.

This model is used in operation of public key cryptographic systems employed by tools like PGP and GnuPG. These tools can use RSA or DSA for asymmetric key generation. A wireless-relevant implementation of GnuPG is its use by the NoCat wireless authentication portal to sign the messages exchanged, thus avoiding the forgery so easily performed on WLANs. When key exchange is implemented in various networking operations, the key agreement is frequently done using the original DH scheme operation based on the discrete logarithms in the finite space calculation problem. The DH standard is outlined in NIST FIPS PUB 186-1 and FIPS 186-2. Common DH key sizes are 768, 1,024, and 2,048 bits. Authenticated DH uses digital signatures to foil man-in-the-middle attacks and has proven to be quite reliable, but slow. ACLs based on the Authenticated DH signatures can be implemented when running IPSec. To address some of the DH cryptosystem drawbacks, the Elliptic Curve DH key exchange scheme was proposed. It has obvious performance and keyspace size advantages over the original DH implementation. Unfortunately, the Elliptic Curve DH key exchange scheme is not currently widely implemented by hardware and software vendors.

On this point we conclude our discussion of asymmetric cryptography and applied cryptography background in general and move to the security protocols and software tools that implement the principles and algorithms we have discussed.

legal disclaimer

1) Our website is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringements, please read the Terms of service and contact us to investigate the problem.
2) The E-articles directory team is not responsible for inaccuracies, falsehoods, or any other types of misinformation this tutorial may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. Please read the Terms of service

Useful tools and features

Translate this article to...    Send this article to you or to a friend

Link to this article from your page   
If you like this article (tutorial), please link to it from your web page using the information above. Linking to this page, this is the only way to help us improve our service, the same time providing your visitors with a way to improve their online experience.

related articles

1. 802.11i Wireless Security Standard and WPA
Thus, the main hope of the international 802.11 community and network administrators lies with the 802.11i standard development. Sometimes 802.11i is referred to as the Robust Security Network (RSN) as compared to traditional security network (TSN). The "i" IEEE task group was supposed to produce a new wireless security standard that should have completely replaced legacy WEP by the end of 2003. In the meantime, some bits and pieces of the incoming 802.11i standard have been implemented by wireless equipment and software vendor...

2. Proprietary Improvements to WEP and WEP Usage
The article devoted to the proprietary and standards-based improvements for currently vulnerable 802.11 safeguards. The most publicized 802.11 vulnerability is the insecurity of WEP. We have already reviewed the cryptographic weaknesses of WEP linked to the key IV space reuse and insecure key-from-string generation algorithm. There are also well-known WEP key management issues: All symmetric cipher implementations suffer secure key distribution problems. WEP is no exception. In the original design,...

3. Penetration Testing as Your First Line of Defense
It is hard to overemphasize the importance of penetration testing in the overall information security structure and the value of viewing your network through the cracker's eyes prior to further hardening procedures. There are a variety of issues specific to penetration testing on wireless networks. First of all, the penetration tester should be very familiar with RF theory and specific RF security problems (i.e., signal leak and detectability, legal regulations pertaining to the transmitter power output, and characteris...

4. Asymmetric Cryptography
Message authentication using HMACs works just fine, but how do we distribute symmetric cipher keys among the users? We can pass them around on floppies or fancy USB pen-drives with encrypted partitions on them, but what if many users live all over the world? What if the physical key distribution method takes time and the keys must be frequently changed? This is the case with the traditional WEP, which should be rotated every few minutes. Key-encrypting keys (KEKs) were offered as symmetric cipher keys used only to encrypt...

5. Examples and Analysis of Common Wireless Attack Signatures
The best way of knowing these signatures is trying out the tools in question and sniffing out their output: "Attack through defending, defend through attacking" (Dr. Mudge). The best source on wireless network intrusion tool detection and attack signatures we are aware of is Joshua Wright's "Layer 2 Analysis of WLAN Discovery Applications for Intrusion Detection" and "Detecting Wireless LAN MAC Address Spoofing" papers. A large part of this tutorial is inspired by these brilliant articles and our experience of analyzing WLAN tr...

6. Deploying a Wireless IDS Solution for Your WLAN
How many IDS solutions that implement the recommendations and follow the guidelines we have already discussed are present on the modern wireless market? The answer is none. There are many wireless IDS solutions that look for illicit MAC addresses and ESSIDs on the monitored WLAN. Some of these solutions are even implemented as specialized hardware devices. Although something is better than nothing, in our opinion such "solutions" are a waste of both money and time. They might also give you a false sense of security. Let's...

7. Hash Functions Their Performance and HMACs
Other widely used hash functions include 128-bit MD5 from RSA Data Security, Inc., which is a very fast and commonly implemented hash. MD5 is traditionally used to encrypt Linux user passwords (hashes start with the "$1$" character), authenticate routing protocols like RIPv2 and OSPF, create checksums of binaries in RPMs, and verify the integrity of Free/OpenBSD ports files. The specifications of MD5 are available in RFC 1321. Host intrusion detection tools like Tripwire (http://www.tripwire.com) use MD5 to take snapshots of a syst...

8. Introduction to Applied Cryptography and Steganography
One can set up a reasonably secure wireless or wired network without knowing which ciphers are used and how the passwords are encrypted. This, however, is not an approach endorsed by us and discussed here. Hacking is about understanding, not blindly following instructions; pressing the buttons without knowing what goes on behind the scenes is a path that leads nowhere. Besides, security and quality of service are tightly interwoven, incorrect selection of the cipher and its implementation method can lead to a secure but sluggish...

9. Streaming Ciphers and Wireless Security
Streaming algorithms were designed to avoid speed and throughput penalties due to the implementation of block symmetric ciphers in CFB and OFB modes when bit-by-bit data encryption is required. Streaming ciphers are based on generating identical keystreams on both encrypting and decrypting sides. The plaintext is XORed with these keystreams to encrypt and decrypt data. To generate the keystream, pseudo-random generators (PRNGs) are used, thus placing stream algorithms somewhere between easy-to-break simple XORing with a predefi...