<?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>On the road to Bandol &#187; secure channel</title>
	<atom:link href="https://javacard.vetilles.com/tag/secure-channel/feed/" rel="self" type="application/rss+xml" />
	<link>https://javacard.vetilles.com</link>
	<description>A weblog on Java Card, security, and other things personal</description>
	<lastBuildDate>Mon, 18 Aug 2025 06:48:26 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.32</generator>
	<item>
		<title>JC101-19C: Secure channel protocol</title>
		<link>https://javacard.vetilles.com/2008/11/13/jc101-19c-secure-channel-protocol/</link>
		<comments>https://javacard.vetilles.com/2008/11/13/jc101-19c-secure-channel-protocol/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 20:43:11 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[APDU]]></category>
		<category><![CDATA[secure channel]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/2008/11/13/jc101-19c-secure-channel-protocol/</guid>
		<description><![CDATA[Starting a session Protocol For our session start, we will here use a classical architecture, but with slightly different commands. First, here is a definition of the exchanges between two actors (say, Alice and Bob) to start a secure session: Alice sends a 16-byte random number to a1 &#8230; a16 to Bob. Bob replies with [&#8230;]]]></description>
				<content:encoded><![CDATA[<h2>Starting a session</h2>
<h3>Protocol</h3>
<p>For our session start, we will here use a classical architecture, but with slightly different commands. First, here is a definition of the exchanges between two actors (say, Alice and Bob) to start a secure session:</p>
<ol>
<li>Alice sends a 16-byte random number to a<sub>1</sub> &#8230; a<sub>16</sub> to Bob.</li>
<li>Bob replies with his own 16-byte random number b<sub>1</sub> &#8230; b<sub>16</sub>.</li>
<li>Alice and Bob both encrypt a<sub>1</sub> &#8230; a<sub>16</sub> with their shared secret, getting the value &alpha;<sub>1</sub> &#8230; &alpha;<sub>16</sub>.</li>
<li>Alice and Bob both encrypt b<sub>1</sub> &#8230; b<sub>16</sub> with their shared secret, getting the value &beta;<sub>1</sub> &#8230; &beta;<sub>16</sub>.</li>
<li>The session key becomes &alpha;<sub>9</sub> &#8230; &alpha;<sub>16</sub> &beta;<sub>1</sub> &#8230; &beta;<sub>8</sub>.</li>
<li>Alice sends the value &beta;<sub>9</sub> &#8230; &beta;<sub>16</sub> to Bob, encrypted with the session key, as a proof of authentication.</li>
<li>Bob verifies that the value is correct.</li>
<li>Bob then sends the value &alpha;1 &#8230; &alpha;<sub>8</sub>  to Alice, encrypted with the session key, as a proof of authentication.</li>
<li>Alice verifies that the value is correct.</li>
<li>The session has started.</li>
</ol>
<p>I will not attempt to prove that this algorithm has many interesting properties, but I will just highlight a few of its features:</p>
<ul>
<li>In stepsÂ 1 andÂ 2, both Alice and Bob generate random data that is used in the session startup process, and the session key depends on both sets of random data, as a measure against replay attacks.</li>
<li>In stepsÂ 3 andÂ 4, the simple encryption used here can be replaced by a more complex algorithm, in order to make it more difficult for an attacker to derive the shared secret from a session key.</li>
<li>The value returned by Alice to Bob on stepÂ 6 (and vice-versa on stepÂ 8) as proof of authentication shows that Alice got Bob&#8217;s random data, and that Alice knows the shared secret.</li>
<li>The value returned in stepsÂ 6 andÂ 8 are both encrypted with the session key, in order to avoid giving away precious information about the shared secret to a potential attacker.</li>
</ul>
<p><span id="more-170"></span></p>
<h3>APDU commands</h3>
<p>The next step is to transform this protocol in a sequence of APDU commands exchanged between a card terminal (as Alice), and a card (as Bob). Standard commands exist to do that (<code>INITIALIZE UPDATE</code> and <code>EXTERNAL AUTHENTICATE</code>). However, since our protocol is specific, I will define a specific command to do so, that I will call <code>START SECURE SESSION</code>.</p>
<table border cellpadding=5 cellspacing=0>
<tr>
<th align="left">CLA</th>
<td><code>00</code>, the default value</td>
</tr>
<tr>
<th align="left">INS</th>
<td><code>38</code>, our own instruction byte</td>
</tr>
<tr>
<th align="left">P1</th>
<td><code>00</code>, The current step, <code>00</code> for random data exchange, and <code>01</code> for the authentication step.</td>
</tr>
<tr>
<th align="left">P2</th>
<td><code>80</code>, <code>00</code>, and also RFU.</td>
</tr>
<tr>
<th align="left">Incoming Data</th>
<td>On step <code>00</code>, the random value a<sub>1</sub> &#8230; a<sub>16</sub>  sent by the terminal; on step <code>01</code>, the authentication value &beta;<sub>9</sub> &#8230; &beta;<sub>16</sub> encrypted with the session key.</td>
</tr>
</table>
<p>The algorithm to process a command is as follows:</p>
<ul>
<li>If P1&ne;<code>00</code> and  P1&ne;<code>01</code>, return status word <code>6A86</code>.</li>
<li>If P1=00, manage step <code>00</code>, the generation of random data.
<ol>
<li>If Lr&ne;<code>16</code>, return status word <code>6700</code>.</li>
<li>Copy received data; generate 16 bytes of new random data.</li>
<li>Compute the new session key, and the card&#8217;s authentication data.</li>
<li>Send the 16 bytes of new random data, with status word <code>9000</code>.</li>
</ol>
</li>
<li>If P1=01, manage step 01, the authentication step.
<ol>
<li>If Lr&ne;8, return status word <code>6700</code>.</li>
<li>Compute expected authentication data, and compare it to received one.</li>
<li>If the comparison fails, return <code>6982</code>.</li>
<li>Otherwise, encrypt card&#8217;s authentication data with the session key, and return it to the terminal with status word 9000.</li>
</ol>
</li>
</ul>
<table border cellpadding=5 cellspacing=0>
<tr>
<th align="left">Lr</th>
<th align="left">Out data</th>
<th align="left">SW</th>
<th align="left">Outcome</th>
</tr>
<tr>
<td><code>10</code></td>
<td>b<sub>1</sub> &#8230; b<sub>16</sub></td>
<td><code>9000</code></td>
<td>On step <code>00</code>, the outgoing data is the random value returned by the card.</td>
</tr>
<tr>
<td><code>08</code></td>
<td>&alpha;<sub>1</sub> &#8230; &alpha;<sub>8</sub></td>
<td><code>9000</code></td>
<td>On step <code>01</code>, the outgoing data is  &alpha;<sub>1</sub> &#8230; &alpha;<sub>8</sub>, encrypted with the session key.</td>
</tr>
<tr>
<td><code>00</code></td>
<td>None</td>
<td><code>6A80</code></td>
<td>Data is not as expected</td>
</tr>
<tr>
<td><code>00</code></td>
<td>None</td>
<td><code>6984</code></td>
<td>Terminal authentication failed</td>
</tr>
</table>
<h2>Exchanging messages</h2>
<h3>Protocol</h3>
<p>During a session, some security features need to be added to the messages exchanged between the card and the terminal. We will need to do two things here:</p>
<ul>
<li>Encrypt the content of the command or response in order to protect the confidentiality of its content.</li>
<li>Include a cryptographic checksum of the command or response in order to protect the integrity of its content.</li>
</ul>
<p>In order to keep our protocol simple and secure, we will consider the following simple rule for determining whether or not to apply these messages:</p>
<ul>
<li>All secure session commands will be considered as embedded in a special <code>SEND SECURE COMMAND</code> command.</li>
<li>All other commands will be considered as not covered by the secure session.</li>
</ul>
<p>There is a security rationale behind this. As we have mentioned before, attackers may analyze the commands sent to the card in order to get some information for their attacks. By always using the same command to send secure commands, we provide an elementary protection against this. We will even go a little further by doing the following:</p>
<ul>
<li>Incoming data will always be 251 bytes, regardless of the actual size of the command data (we leave five bytes for the original header).</li>
<li>Similarly, outgoing data will always be 255 bytes, regardless of the actual size of the response data.</li>
</ul>
<p>Of course, such a protocol introduces some overhead. For instance, here, the overhead will be 6 bytes for the header data plus 8 bytes for the command&#8217;s cryptographic checksum, leaving a maximum of 241 actual bytes of incoming data. For outgoing data, the overhead will be 3 bytes for the header (status word and length), and 8 bytes for the the response&#8217;s cryptographic checksum, leaving a maximum of 244 actual bytes of outgoing data.</p>
<p>Another important point is that we want to make sure that no command can be lost during a secure session. Since we are defining a specific command, we have several ways to do that, including:</p>
<ul>
<li><strong>Managing a session command counter</strong>. A counter is increased at every command, and checked on the card. The counter value must be included in the data protected by the command signature.</li>
<li><strong>Change the session key for each command</strong>. This is a very common way of dealing with this issue, which has other advantages, like the fact that the key changes for each command.</li>
</ul>
<p>In order to keep things simple, we will here use a command counter.</p>
<h3>APDU commands</h3>
<p>We can now define the handling of the <code>SEND SECURE COMMAND</code> command.</p>
<table border cellpadding=5 cellspacing=0>
<tr>
<th align="left">CLA</th>
<td><code>00</code>, the default value</td>
</tr>
<tr>
<th align="left">INS</th>
<td><code>3A</code>, our own instruction byte</td>
</tr>
<tr>
<th align="left">P1</th>
<td><code>00</code>, The MSB of the command sequence number.</td>
</tr>
<tr>
<th align="left">P2</th>
<td><code>80</code>, LSB of the command sequence number.</td>
</tr>
<tr>
<th align="left">Incoming Data</th>
<td>251 bytes, including the protected command, followed by some random padding and by a cryptographic checksum.</td>
</tr>
</table>
<p>The algorithm to process a command is as follows:</p>
<ul>
<li>If the concatenation of P1 and P2 is not equal to the expected sequence number (previous one plus one)
<ol>
<li>Close the secure channel session.</li>
<li>Return status word <code>6A86</code>.</li>
</ol>
</li>
<li>If Lr&ne;251, return status word <code>6700</code>. Otherwise, receive the data.</li>
<li>Verify the cryptogram and decrypt the command data.
<ol>
<li>Compute the signature of the 248 first bytes of the APDU buffer using the session key in CBC mode.</li>
<li>Compare this value to the 8 last bytes of the command.</li>
<li>If the values are different, close the secure channel session, and return status word <code>6982</code>.</li>
<li>Otherwise, decipher the first 240 bytes of command data into the 240 first bytes of the APDU buffer.</li>
<li>If the 5th byte of the APDU buffer (Lr of secure command) is 0, replace it with the 6th byte of the APDU buffer (Le of secure command).</li>
</ol>
</li>
<li>Process the secure command normally.</li>
<li>When the outgoing data is ready to be sent, together with the status word,
<ol>
<li>If the length of the outgoing data is greater than 237, replace it with a 0-length data and a status word of <code>6A80</code>.</li>
<li>Copy the outgoing data into the APDU buffer, starting at offset 3.</li>
<li>Copy the provided status word into the APDU buffer at offset 0.</li>
<li>Copy the length of the outgoing data into the APDU buffer as an unsigned byte at offset 2.</li>
<li>If necessary, fill with random data up to offset 240.</li>
<li>Encrypt these 240 bytes on place with the session key.</li>
<li>Compute a digital signature of these 240 bytes using the session key in CBC mode, and store it at offset 240 of the APDU buffer.</li>
<li>Send the 248 bytes of data, with a status word of <code>9000</code>.</li>
</ol>
</li>
</ul>
<p>This description deserves a few explanations about the use of the DES algorithm, which will be provided in the section about implementation.</p>
<table border cellpadding=5 cellspacing=0>
<tr>
<th align="left">Lr</th>
<th align="left">Out data</th>
<th align="left">SW</th>
<th align="left">Outcome</th>
</tr>
<tr>
<td><code>F8</code></td>
<td>Encrypted response of the other command</td>
<td><code>9000</code></td>
<td>All outcomes</td>
</tr>
</table>
<h2>Closing a session</h2>
<h3>Protocol</h3>
<p>The final step of the secure channel protocol is the closing of a session. The objective is here to get a token that proves that the entire session has taken place, and that the session can be considered as successful.</p>
<p>In order to do that, we will use a value that is a XOR of all the digital signature computed during the session, on 16 bytes (8 bytes for incoming command signatures, 8 bytes for outgoing responses signatures).</p>
<p>Upon receipt of a specific command, which will includes a signature computed by the terminal, the card will return this control value, encrypted with the session key. This value could then be used as a proof that the session actually took place, and that it contained a given set of commands.</p>
<h3>APDU commands</h3>
<p>The first thing to do is to update the handling of the <code>SEND SECURE COMMAND</code> APDU command, in order to include in it the management of the session control value, which should be updated during the handling of each command.</p>
<p>The next thing is to define the <code>CLOSE SECURE SESSION</code> command that will be used to close a session and get the session control value.</p>
<table border cellpadding=5 cellspacing=0>
<tr>
<th align="left">CLA</th>
<td><code>00</code>, the default value</td>
</tr>
<tr>
<th align="left">INS</th>
<td><code>3C</code>, our own instruction byte</td>
</tr>
<tr>
<th align="left">P1</th>
<td><code>00</code>, as RFU</td>
</tr>
<tr>
<th align="left">P2</th>
<td><code>00</code>, as RFU</td>
</tr>
<tr>
<th align="left">Incoming Data</th>
<td>8 bytes, including the sequence number, encrypted by the session key</td>
</tr>
</table>
<p>The algorithm to process a command is as follows:</p>
<ul>
<li>If Lr&ne;8, return status word <code>6700</code>. Otherwise, receive the data.</li>
<li>Decrypt the command data and verify it.
<ol>
<li>Decipher the 8 bytes of command data.</li>
<li>Compare the 2 first bytes of data to the current sequence number.</li>
<li>If they are different, close the secure channel session and return the status word <code>6984</code>.</li>
</ol>
</li>
<li>Send the control value.
<ol>
<li>Copy the control value data into the APDU buffer, starting at offset 0.</li>
<li>Encrypt these 16 bytes on place with the session key.</li>
<li>Close the secure session.</li>
<li>Send the 16 bytes of data, with a status word of <code>9000</code>.</li>
</ol>
</li>
</ul>
<p>This description deserves a few explanations about the use of the DES algorithm, which will be provided in the section about implementation.</p>
<table border cellpadding=5 cellspacing=0>
<tr>
<th align="left">Lr</th>
<th align="left">Out data</th>
<th align="left">SW</th>
<th align="left">Outcome</th>
</tr>
<tr>
<td><code>10</code></td>
<td>Encrypted session control value</td>
<td><code>9000</code></td>
<td>Success</td>
</tr>
<tr>
<td><code>00</code></td>
<td>None</td>
<td><code>6700</code></td>
<td>Received other than 8 bytes</td>
</tr>
<tr>
<td><code>00</code></td>
<td>None</td>
<td><code>6984</code></td>
<td>Wrong sequence number</td>
</tr>
</table>
<h2>Wrap-up</h2>
<p>We have provided a definition of a secure channel protocol, as an exercise to better understand the principles of smart card security. Although this protocol has been designed with security in mind, it hasn&#8217;t been subjected to any kind of peer review, and I don&#8217;t even claim to have all the skills required to design a secure channel protocol that can withstand the current stats-of-the-art of cryptographic attacks.</p>
<p>So, please, <em>don&#8217;t even think</em> about using this secure channel protocol directly in a smart card application, without first submitting to an in-depth analysis by a security professional with a strong cryptography background, as it  may include major flaws.</p>
<p>And if you can&#8217;t have this review performed, you are always better off to use a well-known, standard protocol, like those offered by GlobalPlatform, which are available on almost all cards available today, and that have been subjected to a great deal of scrutiny in the past few years.</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2008/11/13/jc101-19c-secure-channel-protocol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JC101-18C: Defining a secure channel from scratch</title>
		<link>https://javacard.vetilles.com/2008/10/07/jc101-18c-defining-a-secure-channel-from-scratch/</link>
		<comments>https://javacard.vetilles.com/2008/10/07/jc101-18c-defining-a-secure-channel-from-scratch/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 15:54:50 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Java Card]]></category>
		<category><![CDATA[secure channel]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/2008/10/07/jc101-18c-defining-a-secure-channel-from-scratch/</guid>
		<description><![CDATA[In the few coming posts, we will define a secure channel protocol from scratch as an example, and provide an implementation for it. This example will also be used as a way to introduce the cryptographic mechanisms that exist in Java Card. Be careful, this is not a tutorial on cryptography. I am not a [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In the few coming posts, we will define a secure channel protocol from scratch as an example, and provide an implementation for it. This example will also be used as a way to introduce the cryptographic mechanisms that exist in Java Card.</p>
<p>Be careful, this is not a tutorial on cryptography. I am not a cryptography expert, and I will just repeat basic ideas. If you want to learn about cryptograpy, consider getting a book like this <a href="http://www.amazon.fr/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.fr%2FSchneiers-Cryptography-Classics-Library-Practical%2Fdp%2F0470226269%3Fie%3DUTF8%26s%3Denglish-books%26qid%3D1223394244%26sr%3D8-3&#038;tag=lesvetilles-21&#038;linkCode=ur2&#038;camp=1642&#038;creative=6746" class="liexternal">Bruce Schneier Compilation</a><img src="http://www.assoc-amazon.fr/e/ir?t=lesvetilles-21&amp;l=ur2&amp;o=8" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<h2>The shared secret</h2>
<p>An essential part of most secure channel protocol is the shared secret (in our case a cryptographic key), and the way in which this secret is protected from disclosure. An attacker is likely to try to get the secret in order to break the protocol. There are two very important properties of the protocol and its keys:</p>
<ul>
<li>Strength. The key strength is usually measured by the number of possible values for the key, which can be considered proportional to the time required to break a single key.</li>
<li>Resilience. The resilience of a protocol is about the consequences of a successful attack. If Charlie is able to find the encryption key for a message, will he be able to decipher all messages between Alice and Bob? Will he also be able to decipher the messages exchanged by all users of the same protocol? If a protocol is able to limit the consequences of a successful attack, it is considered as resilient.</li>
</ul>
<p><span id="more-165"></span></p>
<h3>Key strength</h3>
<p>Let&#8217;s start by the strength; by studying an example. The DES algorithm uses a 8-byte key, in which only 7 bits per byte are used (the last one is used as checksum, or parity bit). This make 56 bits, and the number of possible keys is:</p>
<p>2^56 = 72057594037927936 ~ 7.2 x 10^16</p>
<p>This looks like a large number, but today&#8217;s computers are fast. If we consider that it takes one microsecond to try a key on a message, we then need only  7.2&#215;10^10 second, or 2&#215;10^7 hours, or about 2284 years. At first, this sounds good enough, as nobody expects their application to last that long. But then, think about a hacker who controls a botnet with 100,000 computers (apparently, these are quite common). With that many computers doing the work, it will take less than 10 days to break a key. And that is way too small for any serious application.</p>
<h3>Protocol resilience</h3>
<p>That&#8217;s where resilience becomes important. Let&#8217; say that that Charlie has discovered the key used by Alice to encipher a message. If the same key is used for every communication by the protocol, he may be able to decipher all messages exchanged by anybody who uses the protocol. That would definitely be a bad protocol, and an interesting way for an attacker to keep a botnet busy. There are two classical ways to reduce these consequences and make the protocol more resilient:</p>
<ul>
<li>Session keys. The idea is here to generate a new key for every session, that will be somehow derived from the shared secret. That way, if Charlie breaks a session key, it will only apply to a single session. If measure are taken to ensure that a session only lasts a limited time (a few seconds are sufficient for most sessions), then the attacker has to be very fast (in our example, it would take a botnet of a billion computers to break a DES key in 20 seconds; and that&#8217;s not realistic today).</li>
<li>Diversified keys. The idea is here to generate a master key that is known by a centralized entity (let&#8217;s say, a bank), and to compute a diversified key for every card, for instance by using the card&#8217;s number. That way, if Charlie breaks a message sent by Alice, the secret that he will get will only be good for the messages sent by Alice, and not for those sent by anybody else.</li>
</ul>
<h3>Principles of the solution</h3>
<p>Now, let&#8217;s see what we can do in our case. We will combine a few measures:</p>
<ul>
<li>We will use a triple-DES key, <em>i.e.</em>, a 16-byte key from which 112 bits are used (you can do the computation that shows that such a key is quite difficult to break).</li>
<li>We will use diversified keys, <em>i.e.</em>, we will consider that the key used by the each card application instance is in fact computed from a master key and from an instance identification number.</li>
<li>We will use session keys, <em>i.e.</em>, we will compute a specific key for each session, in order to minimize the use of the actual card keys.</li>
</ul>
<p>Stating this is a good start, but we all have read horror stories about little details that led to the demise of some cryptographic protocol, so there are more things to consider.</p>
<h3>Key diversification</h3>
<p>The objective of key diversification is to use a single â€œbigâ€ secret to secure a large number of application instances. As mentioned previously, the typical example is a bank, or payment system, in which the master secret is known by the bank, but individual customers only get a diversified key, computed from the master secret and from their account number.</p>
<p>Of course, in a case like that, an attacker may try to guess the master secret by breaking the diversification function. Since the account number (or any number used to diversify a key) must be considered public, the complexity of breaking the master secret only depends on the size of the secret and the strength of the diversification function. Let&#8217;s consider a few functions:</p>
<ul>
<li>Triple-DES encryption. The idea is here that the diversified key is the result of the encryption of the diversification data by the master key. With today&#8217;s technology, this is not bad.</li>
<li>Triple-DES encryption, after XOR with a secret random number (or any other transformation of the diversification data). This sounds like a good idea, because it makes it impossible for an attacker to check that they have indeed found the appropriate key (since they cannot compare the result of the decrypted diversified key with the diversification data). In fact, it simply forces them to attack two diversified keys at once exercise.</li>
<li>RSA signature. The idea is the same as the first one, except that the encryption is here performed using a RSA private key. Making the public key available would allow anybody to verify the validity of a diversified key, but this is not interesting (these keys are supposed to be secret). It is therefore better not to disclose the public key.</li>
</ul>
<p>We have here seen that it is not as obvious as it seems to design such a function. Among the three solutions presented above, I would personally prefer the third one, mostly because it relies on a different technology than the rest of the protocol, which could make it more resilient: if the triple-DES technology is broken, it will have no consequences on RSA, so the diversification algorithm will still be valid.</p>
<p>Anyway, the diversification algorithm is out of the scope of our discussion here, since we are only going to implement the card side of the algorithm, where the key is just considered diversified.</p>
<h3>Session key computation</h3>
<p>Some of the security issues for session key computation algorithms are similar to those encountered for key diversification algorithms, and in particular the fact that it must be difficult to get to the instance key from a session key.</p>
<p>In addition, session keys are also used to ensure that it is not possible to â€œreplayâ€ a transaction, which means that it must not be possible to generate the same key twice. Since such a replay attack must be impossible for both parties, this means that we will need to use some random data coming from each party.</p>
<p>In addition, the computation of the session keys is normally used at the beginning of a session in order to perform the mutual authentication. Since the computation of the key requires both sides to perform computations using the shared secret, this works out fine.</p>
<p>Next time, we will try to map our protocol to APDU commands.</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2008/10/07/jc101-18c-defining-a-secure-channel-from-scratch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
