THEFRONTEND Telegram 1041
​​#learn #tools

I've recently had a proper deep dive into all QR code related stuff.

We needed to get a "check in" system on site with really poor Internet connection. People would come and scan their QR codes from the mobile app using tablet with a simple Web app.

Turns out it's not that difficult once you get a grasp of it.

I've used react-native-qr-svg on mobile to quickly render QR codes. And react-qr-reader on the web.

Now, each user on the server gets a unique id (duh) and also what's called hmac.

The QR itself on mobile is a combination of userId-hmac-totp

The first 2 are used to check if the user is the one they claim to be (aka you can hack userId, but you won't find out their hmac unless you know the secret key), this prevents random people generating QR codes and checking in on site for their friends.

The last totp part really is just One Time Password mechanism using OTPAuth. It refreshes every 10 seconds and rerenders the QR code, similar how you'd expect authenticator apps to work, except contained within QR.

This prevents users to screenshot and share their QR codes with friends for them to check in for you.

And that's it really. You get your fairly secured QR rendering and scanning mechanism, can now use it almost anywhere: office, sites, restaurants, parking, gyms, you name it.



tgoop.com/thefrontend/1041
Create:
Last Update:

​​#learn #tools

I've recently had a proper deep dive into all QR code related stuff.

We needed to get a "check in" system on site with really poor Internet connection. People would come and scan their QR codes from the mobile app using tablet with a simple Web app.

Turns out it's not that difficult once you get a grasp of it.

I've used react-native-qr-svg on mobile to quickly render QR codes. And react-qr-reader on the web.

Now, each user on the server gets a unique id (duh) and also what's called hmac.

The QR itself on mobile is a combination of userId-hmac-totp

The first 2 are used to check if the user is the one they claim to be (aka you can hack userId, but you won't find out their hmac unless you know the secret key), this prevents random people generating QR codes and checking in on site for their friends.

The last totp part really is just One Time Password mechanism using OTPAuth. It refreshes every 10 seconds and rerenders the QR code, similar how you'd expect authenticator apps to work, except contained within QR.

This prevents users to screenshot and share their QR codes with friends for them to check in for you.

And that's it really. You get your fairly secured QR rendering and scanning mechanism, can now use it almost anywhere: office, sites, restaurants, parking, gyms, you name it.

BY TheFrontEnd🔥


Share with your friend now:
tgoop.com/thefrontend/1041

View MORE
Open in Telegram


Telegram News

Date: |

Earlier, crypto enthusiasts had created a self-described “meme app” dubbed “gm” app wherein users would greet each other with “gm” or “good morning” messages. However, in September 2021, the gm app was down after a hacker reportedly gained access to the user data. 2How to set up a Telegram channel? (A step-by-step tutorial) During the meeting with TSE Minister Edson Fachin, Perekopsky also mentioned the TSE channel on the platform as one of the firm's key success stories. Launched as part of the company's commitments to tackle the spread of fake news in Brazil, the verified channel has attracted more than 184,000 members in less than a month. Each account can create up to 10 public channels It’s yet another bloodbath on Satoshi Street. As of press time, Bitcoin (BTC) and the broader cryptocurrency market have corrected another 10 percent amid a massive sell-off. Ethereum (EHT) is down a staggering 15 percent moving close to $1,000, down more than 42 percent on the weekly chart.
from us


Telegram TheFrontEnd🔥
FROM American