Passkey’s are a new brand name for WebAuthn + CTAP2 from FIDO2 standards. The underlying technology uses FIDO2 compliant Public key Cryptography targeted for Web applications. Passkey makes the FIDO2 authentication method only available to people using hardware devices like Yubikeys available to everyone by making mobile phones and popular OSes supporting storage and syncing of the private keys used for authentication. 

Some keywords to quickly understand the technology:

WebAuthn/FIDO2 = Passkey

Discoverable Credential or discoverable WebAuthn/FIDO2 Credential = Passkey

FIDO2 devices and Passkeys generates Public – Private key pairs and then stores the private key securely. The public key is stored by a FIDO2 complaint backend service which then allows authentication. When a user wants to access a website in a computer using Passkeys, assuming the user has previously signed up using a mobile device, then the browser requests the mobile device to authenticate on behalf of the browser. Such communication between mobile devices and computers uses CTAP2 and the transport protocol is Bluetooth in the case of mobile devices (Both iOS and Android). In the case of devices like NFC rings, the transport protocol is replaced with NFC.

What is FIDO2 ?

Fast Identity Online (FIDO) is standard to handle password less authentication on mobile devices, web browsers and in operating systems. 

FIDO2 handles:

  • Authentication
  • Registration

What is WebAuthn ?

W3C standard for web authentication supported by major browsers. WebAuthn makes it possible to use websites using the FIDO2 authentication method.

What is CTAP2 ?

Client to Authenticator Protocol – Establishes connection with an external authenticator like a Mobile phone, Security key etc.

The underlying transport for CTAP is : NFC, USB HID, Bluetooth (smart and BLE)

Passkeys vs YubiKey

Copyable, Syncable, Sharable, Multi Device FIDO2/WebAuthn keys

Incorporating Passkey 

For incorporating Passkey, we would need support for the technology, ie authentication in the frontend and a back-end server which is FIDO2 complaint. The back-end system essentially stores Public keys corresponding to a device’s passkey and uses the same to process authentication requests it receives from Authenticators like Mobile devices or dedicated Multi Factor tools like YubiKey.

In a nutshell, any application wanting to provide support for Passkey must incorporate frontend support and use a backend. Popular services like Auth0 are already offering Passkey support.

Blockchains and Passkey

Since blockchains and Passkey’s are using Public Key encryption scheme, one obvious questions is whether it’s possible to use Passkey to access blockchains. Additionally is it possible to use Passkey with a popular Ethereum wallet like Metamask ?

The answer to this question is depends on the type of Encryption Algorithm, mostly Elliptic Curve used in generation of the keys in Passkeys (WebAuthn) and in the blockchains.

FIDO2 uses NIST FIPS 186-4 mentioned the Elliptic Curves mentioned in “Appendix D: Recommended Elliptic Curves for Federal Government Use” . secp256r1 aka NIST P-256 is suggested but Chains like Ethereum and Bitcoin uses secp256k1. EOSIO blockchain on the other hand added support for secp256r1.

Polkadot blockchain uses Schnorrkel signature scheme and the Curve25519 which are relatively new and not yet included in the NIST or FIDO2 specifications.

References

  1. https://www.yubico.com/blog/a-yubico-faq-about-passkeys/
  2. https://ethereum.stackexchange.com/questions/82530/why-ethereum-based-dapps-dont-use-webauthn
  3. EOSIO support for secp256r1 :  https://web.archive.org/web/20230509092832/https://github.com/EOSIO/eos/pull/7421 & https://web.archive.org/web/20230508180031/https://github.com/Gimly-Blockchain/eosio-did-spec/issues/5
  4. Safe Curves : https://web.archive.org/web/20230423144205/https://safecurves.cr.yp.to/
  5. End user doc https://fidoalliance.org/how-fido-works/
  6. Awesome Webauthn: https://github.com/herrjemand/awesome-webauthn
  7. Encrypting data with a WebAuthn https://blog.millerti.me/2023/01/22/encrypting-data-in-the-browser-using-webauthn/
  8. largeBlob : https://stackoverflow.com/questions/74705538/webauthn-api-ignores-most-extensions-largeblob
  9. credBlob https://github.com/w3c/webauthn/issues/1613
  10. https://lists.webkit.org/pipermail/webkit-dev/2021-March/031755.html

In a session about digital forensics, we happen to discuss about timestamps used in the case of digital forensic and it immediately captured my attention.

I had few questions & thought of write them down.

  • How is time captured
  • What is the official source of time ?
  • Bharathiya Nagarik Suraksha Sanhita (BNSS) suggests the use of mobile phone to record the search and seizure procedure – Which NTP servers they are to be connected at the time of recording the videos ?
  • BSA allows digital evidence
  • evidence captured has wrong timestamp

Time in connected devices

Computers and mobile phones and most of the devices connected to the internet receives time from the local ISP or via time synchronization servers operated by companies is like Apple, Microsoft etc. The Network Time Servers (NTP) are not always reliable.

[ An example of issue with time servers ]

CERT-IN and related organizations are given directions to use certain specific NTP servers as described in the FAQs.

Is it required to synchronise clocks only with NTP Servers of NPL and NIC?
Is it now required to set system clocks in Indian Standard Time (IST) only?
Ans.: The requirement of synchronising time is stipulated to ensure that only standard
time facilities are used across all entities. Organisations may use accurate and standard
time source other than National Physical Laboratory (NPL) and National Informatics
Centre (NIC) as long as the accuracy of time is maintained by ensuring that the time
source used conforms to time provided by NTP Servers of NPL and NIC.

Wrong time

Incorrect time in digital devices like mobile phones or computers will result wrong time stamps in artifacts. They can be:

  • Wrong file creation timestamps
  • Wrong access or modification timestamp
  • Metadata of photos/videos ends up with wrong timestamp
  • Log files created may have wrong timestamps

Evidence or other data without correct time stamps can put time and thus related events in the past or future.

Creating a computing device in the past

Simple cases like clock skews or BIOS batteries not working are known and perhaps the Standard Operating procedures existing to account for such cases. External anchors can be used to detect clock skews and find correct timeline. However there can be interesting scenarios that can be investigated.

  • Boot a device from an older version of Operating System
  • Use a LiveCD or USB device
  • Make sure there is no BIOS battery
  • Change MAC Addresses of the device or arbitrary numbers before connecting to network
  • Disable NTP

I am not being specific or being elaborate for specific reasons but I hope we are very serious about “time” !

Over the last 3 months or so I have been receiving emails or Linkedin messages that generally talks about needing help with a software project. Initial emails simply shared a link to a bitbucket code base and requested to help with it. The profiles involved were all new Harvard educated individuals and easy to identity as scam.

The recent ones are bit more creative and are from Linkedin profiles which are much more believable with recommendations and long history.

Unlike the initial contacts who shared various code bases in Python or NodeJS in the first day itself, latest messages follows a multi day initiative.

On the third day, I got the code base and this time they also have a functional specification !

What’s in the code ?

The code provided seems to be slightly changed boilerplate code (LLMed ?) in React or Javascript with instructions to run locally. Somewhere in the code base there is an encoded function which is either loaded from an external URL or in one of the source files like the first screen shot in the image.

Encoded malicious code being fetched from an external URL
Typescript codebase with encoded malicious code

I took pains to use a secure environment to run the first of the lot which was attempting to access a blockchain wallet. The latest ones looks to be different and attempting to download external code. (Needs further verification.)

In any case, if you happen to get emails/messages requesting help with some code base and access to code, be careful and ignore if you are not sure about what its all about. Do not run the code on your computers!

This is a peculiar post about a nice little DNS service I came across few days ago. While reviewing a pull request I came across an address along the lines https://192.168.1.56.nip.io & I couldn’t find an immediate clarification and searching I could find the Github repo of the project but I couldn’t understand how it worked.

Later our DevOps engineer had to explain to in detail on what this is and how it works !

The nice little utility service has per-created wild card DNS entries for the entire private IP address range. Queries like NOTEXISTING.192.168.2.98.nip.io will get resolved to 192.168.2.168

bkb@bkb-dev-server1:~/src/discovery$ dig NOTEXISTING.192.168.2.98.nip.io

; <<>> DiG 9.16.1-Ubuntu <<>> NOTEXISTING.192.168.2.98.nip.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12130
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;NOTEXISTING.192.168.2.98.nip.io. IN    A

;; ANSWER SECTION:
NOTEXISTING.192.168.2.98.nip.io. 86400 IN A     192.168.2.98

;; Query time: 583 msec
;; SERVER: 208.66.16.191#53(208.66.16.191)
;; WHEN: Mon Nov 27 03:50:17 AST 2023
;; MSG SIZE  rcvd: 76

This is a very useful trick if we don’t want to edit /etc/hosts or equivalent for tools or software running locally or for scenarios where a DNS record is required.

Learn more https://nip.io