<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>2fa on Learning Journey of Alexander Allgäuer</title><link>https://bitlex.li/tags/2fa/</link><description>Recent content in 2fa on Learning Journey of Alexander Allgäuer</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 13 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://bitlex.li/tags/2fa/index.xml" rel="self" type="application/rss+xml"/><item><title>YubiKey: HMAC-SHA1 Challenge-Response</title><link>https://bitlex.li/tutorials/yubikey-hmac-sha1-challenge-response/</link><pubDate>Mon, 13 Apr 2026 00:00:00 +0000</pubDate><guid>https://bitlex.li/tutorials/yubikey-hmac-sha1-challenge-response/</guid><description>&lt;p&gt;Configure HMAC-SHA1 Challenge-Response on a YubiKey&amp;rsquo;s second OTP slot.&lt;/p&gt;
&lt;h2 id="check-slot-status"&gt;Check slot status&lt;/h2&gt;
&lt;p&gt;Use &lt;code&gt;ykman otp info&lt;/code&gt; to make sure your second slot isn&amp;rsquo;t already used. Slot 1 is typically reserved for Yubico OTP.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ykman otp info
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Slot 1: programmed&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Slot 2: empty&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="configure-otp-slot-2"&gt;Configure OTP slot 2&lt;/h2&gt;
&lt;p&gt;Generate a shared secret and program &lt;strong&gt;both&lt;/strong&gt; YubiKeys (primary + backup) with the &lt;em&gt;same&lt;/em&gt; secret so either can open the database.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;SECRET&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;$(&lt;/span&gt;openssl rand -hex 20&lt;span style="color:#66d9ef"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ykman otp chalresp --touch &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; $SECRET &lt;span style="color:#75715e"&gt;# Key 1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ykman otp chalresp --touch &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; $SECRET &lt;span style="color:#75715e"&gt;# Key 2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;unset SECRET
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;--touch&lt;/code&gt; flag is optional, but when you think about it, it absolutely makes sense — you want physical presence confirmation before the key responds.&lt;/p&gt;</description></item><item><title>YubiKey: Introduction</title><link>https://bitlex.li/posts/yubikey/</link><pubDate>Mon, 13 Apr 2026 00:00:00 +0000</pubDate><guid>https://bitlex.li/posts/yubikey/</guid><description>&lt;p&gt;&lt;strong&gt;YubiKey&lt;/strong&gt; is a hardware security key manufactured by &lt;strong&gt;Yubico&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;YubiKeys support a wide range of authentication standards, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;FIDO2 / WebAuthn&lt;/li&gt;
&lt;li&gt;FIDO U2F&lt;/li&gt;
&lt;li&gt;Smart card (PIV)&lt;/li&gt;
&lt;li&gt;OpenPGP&lt;/li&gt;
&lt;li&gt;OATH-TOTP / HOTP&lt;/li&gt;
&lt;li&gt;Yubico OTP&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="rule-1-always-buy-two"&gt;Rule #1: Always buy two&lt;/h2&gt;
&lt;p&gt;When ordering a YubiKey, always put &lt;strong&gt;two&lt;/strong&gt; of them in the shopping cart. Saving a few bucks on a backup key can leave you with a single point of catastrophic failure. They come with a hole that lets you attach one to your keychain while the other stays in another safe, trusted location.&lt;/p&gt;</description></item><item><title>YubiKey: Management Tool</title><link>https://bitlex.li/tutorials/yubikey-management/</link><pubDate>Mon, 13 Apr 2026 00:00:00 +0000</pubDate><guid>https://bitlex.li/tutorials/yubikey-management/</guid><description>&lt;h2 id="yubikey-management-tools-installation"&gt;Yubikey Management Tools Installation&lt;/h2&gt;
&lt;p&gt;We need yubikey-manager
Smart Card Daemon middlware.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo pacman -S yubikey-manager pcsclite ccid
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl enable --now pcscd.service
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl enable --now pcscd.socket
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Verify if the key is detected:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ykman info
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre tabindex="0"&gt;&lt;code&gt; @slexi  ykman info 
Device type: YubiKey 5C NFC
Serial number: 25997589
Firmware version: 5.4.3
Form factor: Keychain (USB-C)
Enabled USB interfaces: OTP, FIDO, CCID
NFC transport is enabled

Applications USB NFC 
Yubico OTP Enabled Enabled
FIDO U2F Enabled Enabled
FIDO2 Enabled Enabled
OATH Enabled Enabled
PIV Enabled Enabled
OpenPGP Enabled Enabled
YubiHSM Auth Enabled Enabled
&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>