The FIDO2 PIN (2024)

The FIDO2 standards contain some special requirements on the PIN. One constraint is thatthe PIN must be supplied as "... the UTF-8 representation of" the "Unicode characters inNormalization Form C". Another constraint is that the PIN must be a minimum lengthmeasured in "code points" (the standard declares, "This specification attempts to countcode points as an approximation of Unicode characters"), and a maximum length measured inbytes (described further below).

What does that mean? How does one build such a PIN?

Unicode characters

First, let's look at "Unicode characters". The Unicode standard specifies a number foreach character supported. For example, the number for cap-A is U+0041 or 0x000041.The number for the lower case greek letter pi (π) is U+03C0. There is no logicallimit to numbers, but currently the maximum Unicode number is 0x10FFFF (21-bits, or 3bytes).

Unfortunately, it is also possible to create "combinations". There is a "block" of unicodenumbers that are "combining diacritical marks", meaning that when they appear in an arrayof characters, software that can render Unicode will know to combine them with theprevious character. For example, the Unicode for lower case e is U+0065, and theUnicode for "acute accent" is U+0301 (the acute accent is a small, diagonal line above aletter, sort of like a single quote or forward slash). Combine the two

 char[] eWithAcute = new char[] { '\u0065', '\u0301' };

and the result is a lower case e with an acute accent: é.

There is also a Unicode number for an e with an acute accent: U+00E9. In other words,there are two ways to represent this letter in Unicode.

 char[] eWithAcute = new char[] { '\u0065', '\u0301' }; char[] sameCharacter = new char[] { '\u00E9' };

Normalization

In order to use a PIN, there has to be one and only one way to encode the characters.Otherwise, someone could enter the correct PIN and if the underlying platform encodes itdifferently than the original one, then it would not authenticate. So the second elementof the PIN is normalization. There is a standard that specifies how to "convert" most ofthe combinations into single numbers. For example, normalization can convert0065 0301 into 00E9.

Hence if your PIN is normalized, then there is only one set of numbers to represent it.The standard specifies a number of ways to normalize, and FIDO2 has chosen the techniquedescribed as "Form C".

UTF-8

Once the PIN has been normalized, it is in essence an array of Unicode numbers. It wouldbe possible to specify that each character in the PIN be a 3-byte (big endian) number. Itwould also be possible to specify that only 16-bit characters be allowed in a PIN andencode it as an array of 2-byte values. However, the standard specifies encoding it asUTF-8. In this encoding scheme, many characters can be expressed as a single byte, ratherthan two or three. In addition, there are no 00 bytes in UTF-8. For example, cap-C isU+0043 and in UTF-8, it is 0x43. The letter pi is U+03C0, and is encoded in UTF-8 as0xCB80. In this way, it is possible to save space by "eliminating" many of the 00bytes.

Actually, the encoding scheme is efficient only in that it treats ASCII characters assingle bytes. There are non-ASCII Unicode characters that are only one byte (U+00xx),and are UTF-8 encoded as two bytes, and some two-byte Unicode characters that areencoded using three bytes, and three-byte Unicode encoded in four bytes. However, becauseASCII characters are the most-used characters, the efficienices usually outweigh theinefficiencies.

C# and Unicode

Your PIN collection code will likely include some code that does something like this.

 while (someCheck) { ConsoleKeyInfo currentKeyInfo = Console.ReadKey(); if (currentKeyInfo.Key == ConsoleKey.Enter) { break; } inputData = AppendChar(currentKeyInfo.KeyChar, inputData, ref dataLength); }

You read each character in the PIN as a char and append it to a char[]. You could usethe string class, but Microsoft recommends not using the string class to hold sensitivedata. This is because:

System.String instances are immutable, operations that appear to modify an existinginstance actually create a copy of it to manipulate. Consequently, if a String objectcontains sensitive information such as a password, credit card number, or personal data,there is a risk the information could be revealed after it is used because yourapplication cannot delete the data from computer memory.

By reading each PIN as a char, you are limiting the characters you support to those thatcan be represented as a 16-bit number in the Unicode space. You would not supportU-10000 to U+10FFFF. This will almost certainly be no problem, because these numbersalmost exclusively represent emojis and other figures (e.g. U+1F994 is a hedgehog:🦔), along with rare alphabets (e.g. U+14400 to U+14646 are for Anatolianhieroglyphs).

See Also
Device setup

You now have a char array to represent the PIN.

C# and Normalization

At this point, you need to normalize. For example, suppose that someone has a Germankeyboard and originally set a FIDO2 PIN that included a lower case u with an umlaut(ü). That keyboard represented the character as U+00FC. But now this person isusing a keyboard that has no umlaut so uses the keystrokes Option-U followed by u.Maybe the platform reads it as U+00FC, but maybe it reads it as U+0075, U+0308.

If the char array is normalized, U+00FC will stay U+00FC, but U+0075, U+0308 will beconverted to U+00FC.

How does one normalize in C#? Unfortunately there are no good solutions. Here are threepossibilities: ignore the problem and assume no one will use a PIN that really needsnormalization, write your own normalization code (or obtain something from a vendor), oruse the String.Normalize method which would store the PIN in a new immutable stringinstance.

Assume PINs will not need normalization

This might not be unsafe. While it is possible to have a PIN that when entered is not thesame as the normalized version, it is not likely.

First of all, a PIN that consists of only ASCII characters is normalized. Second, mostpeople will choose a PIN that does not contain unusual characters. And third, there isa good chance that the keyboard or PIN-reading software will return the normalized versionof a character even if some other form is possible.

Write your own normalization code

To do so, you will likely reference the Unicode standard along with the NormalizationAnnex to develop some class that can read a char array and convert those values to thenormalized form C. For example, your program might read all the characters and determineif there are any characters from the "combining diacritical marks" block. If so, combinethem with the appropriate prior character and map to the normalized value.

Alternatively, you might want to use some Open Source normalization code or find someother vendor with some module that can perform the appropriate operations.

 char[] pinChars = CollectPin(); char[] normalizedPinChars = PerformNormalization(pinChars);

Normalization using the string class

As we saw above, holding sensitive data in a string carries some risk. Whether or notthis is an acceptable risk for your application is something that you will need todetermine. If your application's risk profile would allow the use of the string class,here's what you can do.

 char[] pinChars = CollectPin(); char[] normalizedPinChars = PerformNormalization(pinChars); . . .public char[] PerformNormalization(char[] pinChars){ string pinAsString = new string(pinChars); string normalizedPin = pinAsString.Normalize(); return normalizedPin.ToCharArray();}

C# and UTF-8

Once you have an array of characters, you can convert that into UTF-8 using the C#Encoding class.

 byte[] utf8Pin = Encoding.UTF8.GetBytes(normalizedPinChars);

This byte array is what you pass to theSetPinCommand.

If you are using the string class to normalize, your code could look something likethis.

 char[] pinChars = CollectPin(); string pinAsString = new string(pinChars); string normalizedPin = pinAsString.Normalize(); byte[] utf8Pin = Encoding.UTF8.GetBytes(normalizedPin);

Length restrictions

The standard specifies that a PIN must be at least four code points. Remember, thestandard declares, "This specification attempts to count code points as an approximationof Unicode characters".

The standard also specifies that a PIN can be no more than 63 bytes. That means after thePIN has been converted to "... the UTF-8 representation of" the "Unicode characters inNormalization Form C", it is a byte array. That byte array's length must be less than orequal to 63.

It is possible a YubiKey can be manufactured with a longer minimum length (that is allowedby the standard), and it is possible on some YubiKeys to programmatically increase theminimum length. You can find the minimum PIN length on any YubiKey in theAuthenticatorInfo'sMinimumPinLength property.

The standard does not allow increasing or decreasing the maximum PIN length.

The FIDO2 PIN (2024)

FAQs

Do you need a PIN for FIDO2? ›

On the FIDO2 Demo tool, selecting "PIN: never" or "PIN: if set" allows our security key without a PIN to complete the test without any additional actions required. However, choosing the "PIN: always" option changes the user verification mode to strictly require a PIN.

What is the PIN policy for the FIDO2? ›

The minimum length of the PIN must be 6 digits. It can be increased using a tool, but it cannot be decreased. The lowest possible minimum length is 6 digits. Sequential numbers in ascending or descending order are not allowed.

How do I reset my FIDO2 key PIN? ›

Click the start button in the bottom left corner of your desktop, type Sign-in Options, then click Sign-in Options under best match. Click Security Key and then click Manage. You now have two options. Option 1 - Change the PIN on you security key.

What is the default PIN for the FIDO2 YubiKey? ›

A YubiKey can have up to three PINs - one for its FIDO2 function, one for PIV (smart card), and one for OpenPGP. The PIV and OpenPGP PINs are set to 123456 by default, but there is no FIDO2 PIN set from the factory.

What happens if I forget my YubiKey PIN? ›

IF YOU DO NOT KNOW YOUR CURRENT PIN:

Please contact the Service Desk to reset your PIN. There is a YubiKey Manager app. However, after evaluation, we do not recommend using it as it runs the risk of wiping data from your device.

What is FIDO2 without password? ›

FIDO2 security keys are an unphishable standards-based passwordless authentication method that can come in any form factor. They're commonly USB devices, but they can also use Bluetooth or near-field communication (NFC).

Should you set a PIN for YubiKey? ›

It is recommended that you set up a PIN before you add services to your YubiKey. The best way to do this is to use YubiKey Manager.

How do I remove the PIN from my YubiKey FIDO2? ›

If you have forgotten your current PIN, the only way to change it is to reset the FIDO2 application of your YubiKey to factory default settings (which will remove the PIN).

How long is FIDO2 key PIN? ›

Length restrictions

The standard also specifies that a PIN can be no more than 63 bytes.

What if I lose my FIDO2 key? ›

What happens if I lose my FIDO key? It is important to have a back-up means of authentication in case a key is lost. A second FIDO key can usually be registered with services, and kept as a back-up. When registering with services, alternative though less convenient authentication methods may also be enabled.

What happens if YubiKey has too many incorrect PIN attempts? ›

YubiKey devices take the latter approach of blocking the PIN - and effectively destroying all private keys - after 8 incorrect attempts.

What is FIDO2 PIN used for? ›

It does for passwordless authentication (e.g. with Microsoft), where the PIN replaces the password as the factor you know. By the way, many websites let FIDO2 devices ask for their PIN because that's the default (user verification = preferred), but they don't perform verification on the server side.

Where do I find my YubiKey PIN? ›

The YubiKey is manufactured with the standard default PIN, PUK, and managment key values:
  1. PIN: "123456"
  2. PUK: "12345678"
  3. Management Key: (Firmware Version 5.6 and below: Triple-DES / 5.7 and above: AES-192), 0x010203040506070801020304050607080102030405060708. 0102030405060708 three times.

How to unblock YubiKey PIN? ›

If this has happened to you, here's how to reset the PIN and start over.
  1. Download and Install YubiKey Manager. ...
  2. Retrieve your PUK. ...
  3. Insert YubiKey and launch YubiKey Manager. ...
  4. Select the PIV application. ...
  5. Click the “Configure PINs” button. ...
  6. Click Unblock PIN button. ...
  7. Enter PUK and new PIN. ...
  8. Finished!
May 13, 2020

How do I set up a FIDO2 security key? ›

Getting Started with Your uTrust FIDO2 Security Key
  1. Step 1: Login. Open your web browser and access your desired application that supports two-step authentication (ie Facebook, GSuite)
  2. Step 2: Register. Follow the step-by-step instructions that are provided to register your FIDO2 key. ...
  3. Step 3: Success.

Top Articles
Recovery of my google colab work
Industry Research for Academic Institutions | IBISWorld
Victory Road Radical Red
Fredatmcd.read.inkling.com
CHESAPEAKE WV :: Topix, Craigslist Replacement
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Savage X Fenty Wiki
Zendaya Boob Job
Aspen.sprout Forum
Leeks — A Dirty Little Secret (Ingredient)
Les Schwab Product Code Lookup
Costco Gas Foster City
Best Nail Salon Rome Ga
Ostateillustrated Com Message Boards
Carolina Aguilar Facebook
Blackwolf Run Pro Shop
Kirksey's Mortuary - Birmingham - Alabama - Funeral Homes | Tribute Archive
College Basketball Picks: NCAAB Picks Against The Spread | Pickswise
Winco Employee Handbook 2022
Garnish For Shrimp Taco Nyt
2021 Volleyball Roster
Betaalbaar naar The Big Apple: 9 x tips voor New York City
Zillow Group Stock Price | ZG Stock Quote, News, and History | Markets Insider
Www Va Lottery Com Result
Gotcha Rva 2022
Koninklijk Theater Tuschinski
Piri Leaked
Move Relearner Infinite Fusion
Divide Fusion Stretch Hoodie Daunenjacke für Herren | oliv
Filmy Met
Tokioof
Issue Monday, September 23, 2024
Craigs List Tallahassee
Why Are The French So Google Feud Answers
Emily Katherine Correro
Joplin Pets Craigslist
Compare Plans and Pricing - MEGA
968 woorden beginnen met kruis
Shane Gillis’s Fall and Rise
Vons Credit Union Routing Number
Costco Gas Foster City
Cleveland Save 25% - Lighthouse Immersive Studios | Buy Tickets
Craigslist Woodward
Deezy Jamaican Food
Rescare Training Online
Christie Ileto Wedding
Plasma Donation Greensburg Pa
Zits Comic Arcamax
Hcs Smartfind
Gainswave Review Forum
Cbs Scores Mlb
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 5528

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.