LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-19-2023, 01:57 PM   #1
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 660

Rep: Reputation: 35
Question [newbie] How does 2FA work?


Hello,

This is not specifically a Linux-related question, but I didn't know where to ask.

Since Twitter will soon remove SMS/text messages for 2FA, I installed and configured FreeOTP.

I'm having a hard time understanding how it works:
  1. To add a new site ("token"), I have to use the app's embedded camera to take a picture of the site's QR code: What does it contain?
  2. How does the app get the six-digit number, that's only usable for a short time? From the site through an Internet connection? In that case, does it mean OTP doesn't work if no Internet connection is available?
  3. Likewise, how do hardware OTP keys get that number?

Thank you.

Last edited by littlebigman; 02-19-2023 at 01:59 PM.
 
Old 02-19-2023, 05:32 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
OTP systems are based on cryptographic algorithms. The idea is that both ends are "seeded" using the same number (probably the number in the QR code), and from then on they can generate the same pseudo-random sequence of numbers.

So no, these systems do not need an Internet connection in order to work.
 
1 members found this post helpful.
Old 02-20-2023, 01:06 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
as it was mentioned, that number is a pseudo-random number, which means it looks like a real random number, but the same number is generated on the two devices (it looks like they are synchronized, but they are not connected to each other). This synchronization is based on a common seed or something similar, which is made only once, at the beginning, when you add a new site.
The generation of the [next] random number is based on a local algorithm, which is built into the hardware key, used by the site (in your case twitter) or your phone without using any external resources, therefore theoretically should work everywhere.
 
1 members found this post helpful.
Old 02-20-2023, 01:44 AM   #4
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 660

Original Poster
Rep: Reputation: 35
Thanks, makes more sense.

Quote:
"The two main methods for delivery of the OTP is:
SMS Based […]
Application Based: This method of OTP generation is done on the user side using a specific smartphone application that scans a QR code on the screen. The application is responsible for the unique OTP digits. This reduces wait time for the OTP as well as reduces security risk as compared to the SMS based delivery.

The most common way for the generation of OTP defined by The Initiative For Open Authentication (OATH) is the Time Based One Time Passwords (TOTP), which is a Time Synchronized OTP. In these OTP systems, time is the cardinal factor to generate the unique password. The password generated is created using the current time and it also factors in a secret key.
https://www.geeksforgeeks.org/one-ti...-cryptography/
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Set Up Two Factor Auth (2FA) on Your Smartphone & Linux Desktop... now. LXer Syndicated Linux News 0 01-10-2017 08:30 PM
multiple authentication and 2FA genderbender Linux - Software 0 11-01-2012 10:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration