[tpm2] Fapi_Decrypt using auth value

Anthony Arrascue <AArrascue at neuroloop.de>
Newsgroups dev.linux.lists.tpm2
Message-ID <[email protected]>
Hello,

I am learning about encryption / decryption using Fapi.
For that purpose, I create a key using tss2_createkey and use tss2_encrypt / tss2_decrypt (and their Fapi equivalents).

tss2_ createkey has the argument -a, --authValue to set up a decryption password.
With tss2_encrypt I generate the cipher text.

The problem is with the decryption process. When I decrypt with tss2_decrypt I got asked for that authValue. If it is given correctly it decrypts the cipher text. However, Fapi_Decrypt will fail throwing an authorization error.

I was wondering how to programmatically enter the authValue? Fapi_Decrypt has no arguments to pass it. Maybe through the FAPI_CONTEXT?

Using TPM2-TSS v. 2.4.x
TPM2-TOOLS v. 4.X

Thank you for any possible help.
Best,


Anthony Arrascue
--------------------------------------
neuroloop GmbH
Breisacher Str. 86, 79110 Freiburg, Germany
aarrascue(a)neuroloop.de<mailto:aarrascue(a)neuroloop.de>
neuroloop.de
attachment.htm (text/html, 4.2 KB)
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="en-DE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="DE">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am learning about encryption / decryption using Fapi.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">For that purpose, I create a key using tss2_createkey and use tss2_encrypt / tss2_decrypt (and their Fapi equivalents).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">tss2_ createkey has the argument -a, --authValue to set up a decryption password.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">With tss2_encrypt I generate the cipher text.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The problem is with the decryption process. When I decrypt with tss2_decrypt I got asked for that authValue. If it is given correctly it decrypts the cipher text. However,
<b>Fapi_Decrypt</b> will fail throwing an authorization error.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I was wondering how to programmatically enter the authValue? Fapi_Decrypt has no arguments to pass it. Maybe through the FAPI_CONTEXT?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Using TPM2-TSS v. 2.4.x<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">TPM2-TOOLS v. 4.X<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you for any possible help.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:10.0pt;color:black;mso-fareast-language:DE">Anthony Arrascue<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:10.0pt;color:black;mso-fareast-language:DE">--------------------------------------<br>
neuroloop GmbH<br>
Breisacher Str. 86, 79110 Freiburg, Germany<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:10.0pt;color:black;mso-fareast-language:DE"><a href="mailto:[email protected]">[email protected]</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:10.0pt;color:black;mso-fareast-language:DE">neuroloop.de<br>
<br>
</span><span lang="EN-GB" style="mso-fareast-language:#2000"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.