<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>exploring software and hardware security &#187; man-in-the-middle</title>
	<atom:link href="http://securityblog.astida.com/tag/man-in-the-middle/feed/" rel="self" type="application/rss+xml" />
	<link>http://securityblog.astida.com</link>
	<description>articles about secure systems, secure protocols, tamperproofing, obfuscation, authentication, attack vectors...</description>
	<lastBuildDate>Tue, 10 Nov 2009 20:44:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to choose the right security protocol?</title>
		<link>http://securityblog.astida.com/2009/11/02/how-to-choose-the-right-security-protocol/</link>
		<comments>http://securityblog.astida.com/2009/11/02/how-to-choose-the-right-security-protocol/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 01:20:47 +0000</pubDate>
		<dc:creator>davitb</dc:creator>
				<category><![CDATA[Attacking secure systems]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[how to design secure systems?]]></category>
		<category><![CDATA[authenticity]]></category>
		<category><![CDATA[confidentiality]]></category>
		<category><![CDATA[diffie-helman]]></category>
		<category><![CDATA[eavesdropping]]></category>
		<category><![CDATA[integrity]]></category>
		<category><![CDATA[man-in-the-middle]]></category>
		<category><![CDATA[replay attacks]]></category>
		<category><![CDATA[security protocols]]></category>
		<category><![CDATA[SPEKE]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://securityblog.astida.com/?p=306</guid>
		<description><![CDATA[We all know that sending data over network and being sure that its confidentiality is not damaged is one of the crucial problems in security engineering. In fact, except some special cases the entire information security area is based on the problem of being able to send information from point A to point B and [...]]]></description>
			<content:encoded><![CDATA[<p>We all know that sending data over network and being sure that its confidentiality is not damaged is one of the crucial problems in security engineering. In fact, except some special cases the entire information security area is based on the problem of being able to send information from point A to point B and making sure that’s its security properties are maintained properly.</p>
<p>Creating secure protocols is not an easy task and this article is not intended to help you to create new protocols from the scratch. There already exist many well designed protocols which will give you all the necessary features to meet your requirements. There are many books and articles about how different secure protocols work and how they are designed. This article is not trying to describe details of these protocols rather it tries to recommend the &#8220;ideal&#8221; protocol for you, which of course doesn’t exist. The question that this article will try to answer is how you should choose the right secure protocol for your particular application.</p>
<p>Choosing the right protocol is also not a trivial task however I believe there are patterns which will help you to solve this task for your particular application. I’m able to recognize these patterns and I’m sure you will also be able to do it once you get the proper knowledge and experience.</p>
<p>We will go over the following topics:</p>
<ul>
<li>Data confidentiality and integrity in protocols</li>
<li>Two types of security protocols</li>
<li>Attacks you should worry about while thinking about protocols</li>
<li>Protocol Choosing Patterns</li>
<li>A demonstrative example</li>
<li>Recommended references</li>
</ul>
<p><span id="more-306"></span><br />
So let’s start.</p>
<h3>Data confidentiality and integrity in protocols</h3>
<p>Before going deep into different security protocols and their problems let’s understand why they exist and what they are protecting from.</p>
<p>In my last article (<a href="http://securityblog.astida.com/2009/10/28/key-concepts-in-information-security/">How to design secure systems? Key concept in Information Security</a>) I was talking about security properties of information. I expressed an idea in that article that the whole problem that information security area is trying to solve is “how to make sure that security properties of an information block are properly maintained during its lifetime and that there is no way to damage them?”. Security protocols are tools which allow us designing systems where the information can be transferred from point A to point B over insecure/un-trusted networks without loosing its security properties. I have highlighted six properties in that article – confidentiality, integrity, authenticity, accessibility, availability, non-repudiation. Although in particular applications other properties also can be damaged while transferring data over un-trusted networks – in most cases only confidentiality, integrity and authenticity are of the major concern of security architects. In this article we will mostly focus on these three security properties.</p>
<p>Let’s see what mean confidentiality, integrity and authenticity of data when it comes to transferring information. We transfer sensitive (confidential, private, important) data everyday in our life – when browsing over web, when chating over Skype or other messengers, when talking over phone, transferring files to other locations in network or internet, sending and receiving emails, watching HD TV at home, when locating our location with GPS, etc.</p>
<p>When we transfer this information we want to be sure that nobody else can get it except the addressee. We also want to be sure that the addressee will receive the information exactly in the form we sent it to her. And finally, when the addressee receives our information she wants to be able to make sure that information really came from us and nobody else who is claiming to be us. So our first requirement is about confidentiality, the second is about integrity and the third – authenticity.</p>
<h3>Two types of security protocols</h3>
<p>Although there may be many criteria which can be used to define different categories for security protocols – I have decided to divide them into two types:</p>
<ul>
<li>Authentication based</li>
<li>Zero knowledge</li>
</ul>
<p>Authentication is a key part in a security protocol. Remember, if you want to maintain confidentiality of data – you need to have an authentication part in your protocol. Otherwise how you would know who you are sending your data to?</p>
<p>However it’s not always possible to have authentication primitives in the systems. This is especially true for embedded systems with restricted capabilities. Sometimes you <span style="text-decoration: underline;">have to</span> restrict yourself with protocols which don’t require authentication and thus are prone to man in the middle attacks.</p>
<p>Let’s see what kinds of attacks are possible on security protocols.</p>
<h3>Attacks you should worry about while thinking about protocols</h3>
<p>There are three important attacks you should worry about while designing a security protocol for your system:</p>
<ul>
<li>Eavesdropping<br />
<img class="aligncenter size-full wp-image-311" title="Eavesdropping" src="http://securityblog.astida.com/wp-content/uploads/2009/11/eaves.jpg" alt="Eavesdropping" width="228" height="285" /></p>
<ul>
<li>The attacker has access to the communication channel over which your data is going to be transferred</li>
<li>The attacker can read everything on this channel</li>
</ul>
</li>
</ul>
<ul>
<li>Replay<br />
<img class="aligncenter size-full wp-image-316" title="Replay" src="http://securityblog.astida.com/wp-content/uploads/2009/11/replay.jpg" alt="Replay" width="530" height="285" /></p>
<ul>
<li>This attack is applicable only to authentication based security protocols</li>
<li>When two legitimate users create a secure session &#8211; attacker records the authentication part of the protocol.</li>
<li>After this the attacker replays recorded messages to one of the users and tries to impersonate as the previous legitimate user.</li>
<li>If the protocol doesn’t have means to protect against replay attack – the attack will be successful.</li>
</ul>
</li>
</ul>
<ul>
<li>Man in the Middle<br />
<img class="aligncenter size-full wp-image-319" title="Man in the Middle" src="http://securityblog.astida.com/wp-content/uploads/2009/11/mitm.jpg" alt="Man in the Middle" width="455" height="285" /></p>
<ul>
<li>Any protocol which doesn’t have authentication part is prone to this attack.</li>
<li>The main idea is that the attacker is acting as a malware which stays between two legitimate users – A and B.</li>
<li>When user A sends a message to user B, the attacker is able to receive this message, change it and send the modified message to user B and vice versa.</li>
</ul>
</li>
</ul>
<p>If you designed/chose a protocol which is protected against these three attacks – you can be sure that your protocol is good enough. There can be cases when your system will have specific requirements and those three attacks won’t cover all possibilities. I’m afraid these cases must be addressed uniquely. However I can assure you that in most cases protecting against eavesdropping, replay and MitM attacks is enough.</p>
<h3>Protocol Choosing Patterns</h3>
<p>There are lots of security protocols available in different cryptography books and publications &#8211; Challenge-Response, OTP, EKE family (EKE, SPEKE, J-PAKE, Augmented-EKE, etc), Kerberos, SSL, Diffie-Hellman, and more. How should you choose the right protocol for you?</p>
<p>Choosing the right protocol highly depends on your requirements. I will try to describe an algorithm here aimed to help you in making the right decision but you should understand that it’s not always going to solve the exact problem you have. There will always be cases specific to your requirements and for these cases the described algorithm will serve you just as a direction and not as a solution.</p>
<p>Suppose you have two components in your system – C1 and C2. These components are connected via an un-trusted network. Your general requirement is to be able to send data from C1 to C2 (and vice versa) and yet maintain the security properties of the sending data.</p>
<ol>
<li>If (C1 and C2 don’t share a secret)
<ol>
<li>If (you are not using PKI) then
<ol>
<li>Implement Diffie-Hellman protocol between them</li>
<li><span style="text-decoration: underline;">You will be protected against Replay and Eavesdropping attacks</span></li>
<li><span style="text-decoration: underline;">However, note that you are not protected against Man in the Middle attacks.</span></li>
</ol>
</li>
<li>Else</li>
<li>If (you want one way authentication &#8211; C1 authenticates C2 and C2 doesn’t authenticate C1) then
<ol>
<li>Implement one way SSL between them. C1 authenticates C2 with certificates (this is how web sites are usually authenticated by the browsers).</li>
<li><span style="text-decoration: underline;">You will be protected against Replay, Eavesdropping and Man in the Middle attacks</span></li>
<li><span style="text-decoration: underline;">Note that you need to address the problem of CLR (certificate revocation list) on C1. For embedded devices it’s not always possible.</span></li>
</ol>
</li>
<li>Else</li>
<li>If (you are able to use PKI) then
<ol>
<li> Implement SSL between them</li>
<li><span style="text-decoration: underline;">You will be protected against Replay, Eavesdropping and Man in the Middle attacks</span></li>
<li>N<span style="text-decoration: underline;">ote that you need to address the problem of CLR (certificate revocation list). For embedded devices it’s not always possible</span></li>
</ol>
</li>
</ol>
</li>
</ol>
<p><span style="text-decoration: underline;"> </span></p>
<ol>
<li>If (C1 and C2 share a secret) then
<ol>
<li>If (there is no trusted Root server) then
<ol>
<li> If (you want one way authentication &#8211; C1 authenticates C2 and C2 doesn’t authenticate C1) then
<ol>
<li>Use Challenge-Response or OTP based protocols</li>
<li><span style="text-decoration: underline;">Authentication will be protected against Replay and Eavesdropping attacks</span></li>
<li><span style="text-decoration: underline;">However, note that authentication process is not protected against Man in the Middle attacks.</span></li>
</ol>
</li>
<li>Else</li>
<li> If (You want mutual authentication between C1 and C2) then
<ol>
<li>Use SPEKE (or other EKE based strong algorithm)</li>
<li><span style="text-decoration: underline;">You will be protected against Replay, Eavesdropping and Man in the Middle attacks</span></li>
</ol>
</li>
<li>Else</li>
<li>If (You want mutual authentication between C1 and C2 but don’t want to have exponentiation block in your protocol) then
<ol>
<li> v.      Use SSL which is not based on PKI. Instead of encrypting the pre-master secret with a private key, encrypt it with the shared symmetric key and transfer to C2.</li>
<li>This is quite effective.</li>
<li><span style="text-decoration: underline;">You will be protected against Replay, Eavesdropping and Man in the Middle attacks</span></li>
</ol>
</li>
</ol>
</li>
<li>Else</li>
<li>If (there is a trusted Root server) then
<ol>
<li> i.      Use Kerberos</li>
<li> ii. <span style="text-decoration: underline;">You will be protected against Replay, Eavesdropping and Man in the Middle attacks</span></li>
</ol>
</li>
</ol>
</li>
</ol>
<h3>A demonstrative example</h3>
<p>Let’s assume we have a USB based biometric sensor. After it is attached to a USB port of a PC, user’s biometrics can be scanned and transferred to the PC where it will be processed.</p>
<p>Now, user’s biometric information is used for authentication purpose and it usually opens privacy problems if not protected well… That’s why it is required to protect the confidentiality, integrity and authenticity of biometric data when it is being sent from the sensor to PC.</p>
<p>Biometric sensor usually doesn’t have enough computation power and internal persistent memory and that’s why we are not always free to choose the “ideal” protocol for our system. We will go over several possible cases and discuss how to choose the right protocol.</p>
<p><em>No shared secret</em></p>
<p>Biometric sensors are now very popular and there are companies which produce such sensors by dozens million of units per year. It’s not always easy to share a secret between these sensors and PC. One of the problems is “where exactly the shared secret will be stored on PC?”. It’s not very secure to store it on hard disc. So this is a real problem. Another problem is how the secret will be provisioned in the sensor? This may impact the manufacturing process and make it more expensive. That’s why it’s quite practical to assume that there is no secret shared between the sensor and PC.</p>
<p>So what should we do here to protect the confidentiality of biometric data?</p>
<p>Let’s see what happens if we decide to send biometric data without protecting it:</p>
<p><img class="aligncenter size-full wp-image-321" title="Eavesdropping" src="http://securityblog.astida.com/wp-content/uploads/2009/11/ex1.jpg" alt="Eavesdropping" width="267" height="232" /></p>
<p align="center">
<p>Hopa, the malware can just read the data by installing a USB Kernel driver and eavesdropping the traffic. That’s not good.</p>
<p>Ok, let’s refer to the algorithm described above and see what it suggests. We are not sharing a secret between Biometric Sensor and PC and we are not using PKI – so we fell in 1.a. After implementing Diffie-Hellman only the man in the middle attack will be possible on our system. Note that because we don’t have authentication – we cannot have a better protocol here. So Diffie-Hellman is the best choice.</p>
<p><em> </em></p>
<p><em>Shared secret</em></p>
<p>Let’s assume we designed a system where each sensor possesses a symmetric key and there is a way to securely install this key on PC when we first time attach the sensor to the PC.</p>
<p>The first idea that will come to mind is to encrypt biometric data with the shared secret when the user provides it and send it to PC.</p>
<p><img class="aligncenter size-full wp-image-323" title="Encrypting biometric data" src="http://securityblog.astida.com/wp-content/uploads/2009/11/ex2.jpg" alt="Encrypting biometric data" width="368" height="232" /></p>
<p align="center">
<p>Data confidentiality is protected here – the eavesdropper cannot decrypt data being send. But, hey, what if the malware records the traffic when a legitimate user provides biometrics and replays this traffic next time? The malware will impersonate a legitimate user in this case and gain access to the system without even having the shared secret. That’s bad and that is called a replay attack.</p>
<p><img class="aligncenter size-full wp-image-325" title="Replay attack" src="http://securityblog.astida.com/wp-content/uploads/2009/11/ex3.jpg" alt="Replay attack" width="748" height="247" /></p>
<p>Ok, let’s go further. Usually replay attacks can be protected by using a random challenge in the protocol. If PC sends a random challenge each time before receiving the biometric data and verifies that random challenge exists in the received package – we might be protected against replays.</p>
<p><img class="aligncenter size-full wp-image-327" title="Random Challenge" src="http://securityblog.astida.com/wp-content/uploads/2009/11/ex4.jpg" alt="Random Challenge" width="386" height="318" /></p>
<p align="center">
<p>This is already not bad. First we protect the confidentiality of biometric data by encrypting it and second, we protect authenticity and integrity by verifying the hashed MAC and making sure that it contains the random challenge. In this case we will also be protected against man in the middle attacks as we are doing one way authentication.</p>
<p>Sometimes it’s also required to authenticate the PC in order for the attacker to not be possible to impersonate PC. In this case above mentioned algorithm will direct us to the cases 2.iii or 2.v.</p>
<h3>Recommended references</h3>
<p><a href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack">http://en.wikipedia.org/wiki/Man-in-the-middle_attack</a></p>
<p><a href="http://en.wikipedia.org/wiki/Eavesdropping">http://en.wikipedia.org/wiki/Eavesdropping</a></p>
<p><a href="http://en.wikipedia.org/wiki/Replay_attack">http://en.wikipedia.org/wiki/Replay_attack</a></p>
<p><a href="http://en.wikipedia.org/wiki/Transport_Layer_Security">http://en.wikipedia.org/wiki/Transport_Layer_Security</a></p>
<p><a href="http://en.wikipedia.org/wiki/SPEKE">http://en.wikipedia.org/wiki/SPEKE</a></p>
<p><a href="http://en.wikipedia.org/wiki/Encrypted_key_exchange">http://en.wikipedia.org/wiki/Encrypted_key_exchange</a></p>
<p><a href="http://en.wikipedia.org/wiki/Kerberos_%28protocol%29">http://en.wikipedia.org/wiki/Kerberos_%28protocol%29</a></p>
<p><a href="http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsecurityblog.astida.com%2F2009%2F11%2F02%2Fhow-to-choose-the-right-security-protocol%2F&amp;linkname=How%20to%20choose%20the%20right%20security%20protocol%3F"><img src="http://securityblog.astida.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://securityblog.astida.com/2009/11/02/how-to-choose-the-right-security-protocol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One-Time Passwords</title>
		<link>http://securityblog.astida.com/2009/10/02/one-time-passwords/</link>
		<comments>http://securityblog.astida.com/2009/10/02/one-time-passwords/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 07:31:01 +0000</pubDate>
		<dc:creator>davitb</dc:creator>
				<category><![CDATA[authentication]]></category>
		<category><![CDATA[challenge-response]]></category>
		<category><![CDATA[HMAC]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[man-in-the-middle]]></category>
		<category><![CDATA[OATH]]></category>
		<category><![CDATA[OCRA]]></category>
		<category><![CDATA[one time passwords]]></category>
		<category><![CDATA[RSA SecureID]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://securebox.wordpress.com/?p=89</guid>
		<description><![CDATA[I decided to continue the series of “user authentication” related articles (which I started with article Conventional Website Authentication Model and its Weaknesses) and bring more details about one-time passwords.
In this article I will overview the following topics:

Basic ideas behind OTP
OTP Types
Vulnerabilities
Standards and Applications

To make the illustration of OTP more practical we will implement a [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to continue the series of “user authentication” related articles (which I started with article <a href="http://securityblog.astida.com/2009/09/27/conventional-website-authentication-model-and-its-weaknesses/">Conventional Website Authentication Model and its Weaknesses</a>) and bring more details about one-time passwords.</p>
<p>In this article I will overview the following topics:</p>
<ul>
<li>Basic ideas behind OTP</li>
<li>OTP Types</li>
<li>Vulnerabilities</li>
<li>Standards and Applications</li>
</ul>
<p>To make the illustration of OTP more practical we will implement a web server with authentication from scratch by trying to integrate an OTP scheme.</p>
<p><span id="more-89"></span></p>
<h3><strong>Basic ideas behind OTP</strong></h3>
<p>Consider a web server which has a database of users and implements a basic user authentication scheme based on passwords. There are various ways to implement a password based authentication server and key decisions to make while designing it. For example, the following questions need to be addressed:</p>
<ol>
<li>Are we going to keep the copies of passwords on server side?</li>
<li>Are we going to have a certificate for server website?</li>
<li>What is the authentication protocol we will implement?</li>
<li>Are we going to send the hash of password during authentication?</li>
<li>…</li>
</ol>
<p>These questions are interconnected. Answer to one will definitely affect the rest of them.</p>
<p>Let’s consider the simplest scheme:</p>
<ul>
<li>The server keeps the hashes of passwords in the database (instead of real copies) and thus doesn’t take unnecessary security responsibility</li>
<li>Once the server received the password, it calculates the hash of it and verifies with the hash stored in the database</li>
<li>If the hashes are equal – user is authenticated</li>
</ul>
<p>Everything looks fine with one exception. Replay attack. An adversary, recording a single authentication session would be able to repeat the steps and get authenticated with the server.</p>
<p>In order to prevent such attack servers usually implement PKI approach. They acquire a certificate from Certification Authorities (such as Verisign) and install it on server. When the user enters this website the browser automatically verifies the certificate of the web server via HTTPS (it’s based on SSL) and creates a one way secure connection. So after this is done the password will be transferred in SSL and will be encrypted with SSL session key. So no replay attack is possible.</p>
<p>This is the simplest and most famous approach for user authentication with web servers. However this approach has several problems which are discussed in my previous article – phishing/pharming attacks, password related problems and man in the browsers attacks…</p>
<p>Imagine that the password never transferred to the server. Imagine a scheme where web server could authenticate the user without receiving any confidential information… Let’s talk little bit about challenge response protocol.</p>
<p><img class="aligncenter size-full wp-image-91" title="Challenge-Response" src="http://securebox.files.wordpress.com/2009/10/cp.jpg" alt="Challenge-Response" width="464" height="266" /></p>
<p align="center">
<ul>
<li>Both user and server share a shared secret (password)</li>
<li>During authentication the server sends a random challenge to the user machine</li>
<li>User’s machine calculates a response with the following formula – CR=HMAC(RC, SS) and sends it back</li>
<li>After receiving CR, the sever calculates the same thing on server side and compares with CR</li>
<li>If they are equal – the user is authenticated</li>
</ul>
<p>If the server is able to generate secure random challenges each time then there is no way to conduct replay, phishing and pharming attacks – because the user never sends a clear password to the server. Instead it sends a one time usable token – based on random number, shared secret and a cryptographically secure hash function. This becomes interesting, right? And note, in ideal case, there is no need to implement PKI based authentication for this scheme (though it would be good to have as other sensitive information is also transferring over wire, such username).</p>
<p>However this scheme doesn’t give much advantage if we are still using passwords. Man in the browser, and social engineering attacks are still possible.</p>
<p>Now suppose that the secret, shared between the user and server, is not a text based password but is a cryptographic key with the length of, say, 128 bit. And suppose that the user possesses a hardware token which is provisioned with this secret and this hardware token is used for authentication purpose.<br />
The hardware has a basic functionality – when it received a random challenge (RC) – it calculates HMAC(RC, SS) and gives back.</p>
<p>So whenever user needs to authenticate with a web server, he puts this device into laptop and authentication succeeds automatically. No replay, phishing, pharming, man in the browser and password related attacks are possible now. Everyone is happy.</p>
<p>This is the basic idea behind OTPs. We have discussed only one type of OTP – challenge response, but as you will see there other types too. However all types share the following concepts:</p>
<ul>
<li>User and server share a secret.</li>
<li>During authentication the OTP device generates a value which is used only one time by the authenticator and which can be calculated on the server too.</li>
<li>Server calculates it and compares with the one that user provided. If they are equal – authentication succeeds.</li>
</ul>
<h3><strong>OTP Types</strong></h3>
<p>As far as I’m aware of there are five types of one-time password schemes:</p>
<ul>
<li>Challenge response (the one that we discussed earlier)
<ul>
<li>Note that this can be considered a real OTP only in case if there is a cryptographically secure random number generator installed on server.</li>
</ul>
</li>
</ul>
<ul>
<li>Counter based</li>
<li>Time based</li>
<li>Counter + challenge response</li>
<li>Paper written OTPs</li>
</ul>
<p>In case of counter based OTPs, beside the secret, OTP device and the server share also a counter. There is usually a trigger on the OTP device. When the user pushes this trigger, device generates a value, something similar to HMAC(counter, shared secret) and sends it to the server. Device increments the counter after the trigger is pushed and data is sent.</p>
<p>As server also shares all data contained in the HMAC it can calculate the same HMAC value and compare with the one that user sent. After authentication succeeds, the server increments the server side counter.</p>
<p>The concept of time based OTP is very similar to counter based one. The difference is that instead of sharing a counter the server and OTP device are calculating the OTP value based on time. In this case the OTP device must have a trusted clock and usually a time circuit is integrated in the hardware which is synchronized with the server time. So when the user pushes the trigger, the following value is calculated &#8211; HMAC(current time, shared secret). The server also calculates a vaue with the same formula and compares with the client’s one.</p>
<p>Counter and time based OTPs schemes share a common problem – the synchronization problem. When device’s counter or time gets out of synch with the server’s one there must be a way to synchronize them. These synchronization techniques usually cause lot of troubles to users and IT administrators and thus affect the overall price of installation.</p>
<p>There are also OTP schemes where a counter is combined with a challenge-response protocol. In this case prior to authentication, the server sends a random challenge (nonce) to the client and OTP device generates the OTP value based on the following formula – HMAC(nonce, counter, shared secret). The counter in this scheme makes sure that the OTP value will never repeat and the server nonce provides more security to the scheme.</p>
<p>There are financial institutions (mostly in Europe) which are using paper written OTPs. The concept is that the user receives a number of different OTP tokens (e.g. 100) and uses them one per one during authentication with a website. The server shares the same amount of OTPs and is able to compare them. These OTP tokens can be sent to the user via SMS or email.</p>
<h3><strong>Vulnerabilities</strong></h3>
<p>Though OTP is able to protect against phishing, pharming, replay, password related attacks however it’s still prone to the man in the middle type of attacks.</p>
<p>The following diagram illustrates the man in the middle attack on a challenge response OTP authentication.</p>
<p><img class="aligncenter size-full wp-image-96" title="Man in the Middle" src="http://securebox.files.wordpress.com/2009/10/mitm.jpg" alt="Man in the Middle" width="427" height="272" /></p>
<p align="center">
<ol>
<li>A malware is installed in the browser</li>
<li>The user enters to a web site</li>
<li>Web sites sends a nonce (rand challenge) and requests for a valid response</li>
<li>OTP device generates the valid response and sends to the server</li>
<li>Malware records this response, generates a fake error message to the user (smth like “some error occurred, please try again”) and continues the session with web server by sending the valid response and getting authenticated.</li>
</ol>
<p>These types of attacks cannot continuously succeed, especially in case of careful users. Usually users will contact with service providers and report about errors. Although the web site will cancel the OTP device after that but the attack already has been successful conducted.</p>
<h3><strong>Standards and Applications</strong></h3>
<p>There are several OTP standards and real life applications:</p>
<ul>
<li>Counter and challenge-response based OTP
<ul>
<li>HOTP</li>
<li>OCRA</li>
<li>Yubico</li>
<li>Vasco</li>
</ul>
</li>
</ul>
<ul>
<li>Time based OTP
<ul>
<li>TOPT</li>
<li>RSA Secure ID</li>
</ul>
</li>
</ul>
<p>Additional information can be found about these standards and their applications in the following resources:</p>
<p><a href="http://en.wikipedia.org/wiki/One-time_password">http://en.wikipedia.org/wiki/One-time_password</a></p>
<p><a href="http://www.openauthentication.org/specifications">http://www.openauthentication.org/specifications</a></p>
<p><a href="http://www.rsa.com/node.aspx?id=1156">http://www.rsa.com/node.aspx?id=1156</a></p>
<p><a href="http://www.vasco.com/">http://www.vasco.com/</a></p>
<p><a href="http://www.yubico.com/home/index/">http://www.yubico.com/home/index/</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsecurityblog.astida.com%2F2009%2F10%2F02%2Fone-time-passwords%2F&amp;linkname=One-Time%20Passwords"><img src="http://securityblog.astida.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://securityblog.astida.com/2009/10/02/one-time-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conventional website authentication model, its weaknesses and alternatives</title>
		<link>http://securityblog.astida.com/2009/09/27/conventional-website-authentication-model-and-its-weaknesses/</link>
		<comments>http://securityblog.astida.com/2009/09/27/conventional-website-authentication-model-and-its-weaknesses/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 08:04:44 +0000</pubDate>
		<dc:creator>davitb</dc:creator>
				<category><![CDATA[authentication]]></category>
		<category><![CDATA[browser security]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[man-in-the-middle]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[pharming]]></category>
		<category><![CDATA[phishing]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://securebox.wordpress.com/?p=77</guid>
		<description><![CDATA[The current article discusses the problems of authentication schemes that are used by websites and browsers while the user logs in to a website.
The following topics will be covered:

Conventional user and website authentication model
Weak points of password based authentication
Weak points of website authentication
Alternative ways for user authentication in websites

Note that by the term “conventional” we [...]]]></description>
			<content:encoded><![CDATA[<p>The current article discusses the problems of authentication schemes that are used by websites and browsers while the user logs in to a website.</p>
<p>The following topics will be covered:</p>
<ul>
<li>Conventional user and website authentication model</li>
<li>Weak points of password based authentication</li>
<li>Weak points of website authentication</li>
<li>Alternative ways for user authentication in websites</li>
</ul>
<p>Note that by the term “conventional” we mean the most popularly used authentication scheme – username/password.</p>
<p><span id="more-77"></span></p>
<h3><strong>Conventional user authentication model</strong></h3>
<p>Conventional authentication scheme for websites and users is based on two steps:</p>
<ul>
<li>User’s internet browser authenticates the website with PKI (through SSL)</li>
<li>Website authenticates the user with username and password</li>
</ul>
<p>Currently most websites require only username and password for user authentication although it’s obvious that the data they are storing on web servers and their services require much stronger security than the passwords can provide.</p>
<h3><strong>Weak points of password based authentication</strong></h3>
<p>Passwords are prone to many attacks, such as:</p>
<ul>
<li>Weak passwords
<ul>
<li>Although there are many recommendations for constructing more secure pass phrases – these recommendations don’t provide the desired effect as the users usually give higher priority to the factor of remembering the password rather than making it secure</li>
</ul>
</li>
</ul>
<ul>
<li>Social Engineering based attacks
<ul>
<li>Passwords are usually designed around personal characteristics of the user (names, birthdays), their friends or relatives</li>
<li>This makes easy to retrieve a password by doing basic social engineering</li>
<li>Users tend to write their passwords on a paper and keep it somewhere close to the computer</li>
</ul>
</li>
</ul>
<ul>
<li>Phishing attacks
<ul>
<li>User’s credentials (username and password) can be obtained by conducting phishing attacks. Those will be discussed in details later in this article.</li>
</ul>
</li>
</ul>
<ul>
<li>Pharming attacks
<ul>
<li>The concept is very similar to phishing attack. The following link provides thorough explanation of this type of attack:<br />
<a href="http://en.wikipedia.org/wiki/Pharming">http://en.wikipedia.org/wiki/Pharming</a></li>
</ul>
</li>
</ul>
<ul>
<li>Malware steals the password
<ul>
<li>Man in the browser malware can easily obtain user’s password after it is submitted to the HTML form</li>
<li>Keyloggers can easily obtain user’s password while it is being entered in a password field</li>
<li>Man in the middle malwares can easily obtain these passwords (this is true if SSL is not used for website authentication)</li>
</ul>
</li>
</ul>
<p>It’s also important to mention that passwords provide only “something you know” authentication factor and if this knowledge is stolen – the attacker can have access to any data and operation that the user has access to.</p>
<p>Having all these said it’s obvious that password based authentication cannot remain the primary scheme for websites which keep sensitive information about users or provide valuable services (like financial or privacy related).</p>
<p><strong> </strong></p>
<h3><strong>Weak points of website authentication</strong></h3>
<p>Although PKI based SSL authentication provides a very strong trust, while visiting websites, there is still one issue which remains unresolved for internet users and websites. This is the problem of phishing. The user, who enters a website, doesn’t pay enough attention to the website’s name and thus can be prone to obvious attacks.</p>
<p>The browser developers didn’t yet invent a proper way to notify the user about website identity (identity can be the website name, something else describing it uniquely… can you think a better way to identify a website than the URL?) she is entering to. For example if you see a link with name “pEypal.com” you may probably not notice it, treat it as “paypal.com” ad just trust it. This is actually what phishing attacks are based on.</p>
<p>In my opinion this problem has two major points. The first is in the browser and the second – in website’s identity.</p>
<ul>
<li>Browser developers must convince the user to always pay attention to the website’s identity (currently URL) they are visiting to</li>
<li>Websites (or Web) must invent a new approach for website identity</li>
</ul>
<p>So the fact is that although website authentication is based on the strongest cryptographic algorithms and protocols – it is still not perfect. Let’s discuss here how phishing attacks work.</p>
<ul>
<li>Attacker creates a website with a similar name that the original one (like for paypal.com it would be smth like peypal.com)</li>
<li>Attacker sends some message (email) to the user from Paypal’s name and asks the user to enter <a href="http://www.peypal.com/">www.peypal.com</a> for more information.</li>
<li>P<span style="text-decoration: underline;">e</span>ypal.com has a very similar user interface as paypal.com and the user likely won’t notice that this is not the real paypal.com</li>
<li>The user provides her username and password, peypal.com first stores this info internally and then redirects this information to the original paypal.com</li>
<li>User is logged in paypal.com and has no doubt that his credentials have been stolen</li>
<li>Refer to the following resource for more information about these popular attacks:<a href="http://en.wikipedia.org/wiki/Phishing"><br />
http://en.wikipedia.org/wiki/Phishing</a></li>
</ul>
<p><strong> </strong></p>
<h3><strong>Alternative ways of user authentication by websites</strong></h3>
<p>In spite of the weaknesses we have mentioned for password based authentication it’s still the most popular authentication scheme used by everyone in the Web – financial institutions, social websites, emails, etc. Of course the reason behind this is not that website developers are not aware of these problems. The problem is that secure alternative approaches require a specialized hardware or software which the users are not willing to buy and install.</p>
<p>The security of user authentication model could be significantly strengthen by integrating specialized hardware such as OTP (One time password) tokens, PKCS#11 tokens, biometric devices (although these still have privacy related problems), corresponding software components. However these hardware tokens cost money and the users, as a rule, are not willing to pay for them – even if it doesn’t cost much. Users also don’t want to download and install software components (applications, browser plugins) for this purpose, because they don’t trust these applications. So how this problem can be solved?</p>
<p>I think the only way to solve it is to use the power that ODMs have. ODMs have a full control of the hardware and software that is being installed <span style="text-decoration: underline;">by default</span> on laptops or PCs. If they decide to integrate a hardware token (and accompanying software) on laptops by default – the abovementioned problem would be solved automatically. Users would obtain a much higher level of security with such systems.</p>
<p>A good example of such hardware token is a fingerprint device which is already in its way to become a mainstream for laptop market.</p>
<p>Let’s summarize the list of alternative ways that hardware tokens or software components can provide for better user authentication:</p>
<ul>
<li>Hardware tokens with OTP support
<ul>
<li>RSA SecureID, Vasco, Yubico, etc</li>
</ul>
</li>
</ul>
<ul>
<li>Cryptographic tokens which support PKCS#11
<ul>
<li>The website could completely support PKI and provide each user with a certificate</li>
<li>The private key of user would be embedded in a PKCS#11 enabled hardware token</li>
<li>In this case two side SSL would be established between the user’s machine and website when the hardware token is connected to the system</li>
<li>Additional factor would be added to authentication scheme if this hardware token generated RSA signature only when, for example, the user provides pre-enrolled biometrics (such as swipes a valid finger)</li>
</ul>
</li>
</ul>
<ul>
<li>Special software could be installed on the user’s machine and provide a better authentication for users
<ul>
<li>As it was mentioned before the problem with this solution is that users usually don’t want to download and install unknown software from web</li>
</ul>
</li>
</ul>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsecurityblog.astida.com%2F2009%2F09%2F27%2Fconventional-website-authentication-model-and-its-weaknesses%2F&amp;linkname=Conventional%20website%20authentication%20model%2C%20its%20weaknesses%20and%20alternatives"><img src="http://securityblog.astida.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://securityblog.astida.com/2009/09/27/conventional-website-authentication-model-and-its-weaknesses/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

