Get phone number from scanned qr code? - qr-code

I read you can setup a qrcode to send an sms message when scanned. My question is, if I scan a qrcode with my phone and that qr code sends a sms message, does it send the phone number that scanned it to send that text message so I know what number to text back if need be?

tl;dr: it's going to depend on the app (and device) the user uses to scan the code.
A qr code is just text. An "sms" qr code just starts with the text "SMSTO:". It's up to the app to decide what to do when it sees that.
What an app can even do depends on the platform. Maybe you can directly send an sms without user intervention on some platforms, but you can't on iOS (unless you don't send the sms from the phone but instead some net service that will send an sms for you; in that case, I strongly suspect you get a different source number).
So unless somehow control what the user is using to scan the code, you don't know what the result will be.

When using qrcodes to send a sms message it only prompts you to the send text message screen on your phone pre-populating it with the message embedded in the qrcode and the number embedded in the qrcode. So it will send the number with the text. They just have to click the send button on their phone.

Related

twilio voice to voice call

We are using QNetworkAccessManager and want to do person to person live call, how do we do this? Can you send a link to find more information where we can find this.
If this is not possible, which other technology can we use to control with a QT c++ application to get this done?
we are using QT 5.15.2, and are able to send text, enter a number which twilio will call with a prerecorded message, but we cannot figure out how to do real voice to voice calls yet.
Somehow we need to redirect audio from the pc (microphone and earpiece) to the twilio voice call while we are able to record this call.
Thank you

Encrypt Telegram chat history

I am currently trying to build a telegram bot for connecting emails with a telegram group.
The users should be able to write several messages and (whenever they wish) send the command /sendEmail to send all previously sent messages per email. (Example chat as in the picture below)
As Telegram provides no way to get the chat history, I need to store every single message the moment it is written. But as I don't want any developer to be able to read them, I'd like to encrypt them in a way they can only be decrypted upon sending the email.
Possible data one could use as encryption key:
Encryption code sent by the bot/user (only sent rarely, not every message for the convenience of the user. Like in the picture)
Does anyone know of a way to encrypt all messages until the user sends sendEmail?

How to send external message in R (without providing sender account)

Is it possible to send an external message (e.g., and email or SMS text, tweet, etc.) via R without providing a sending account?
If so, how would one send a quick message to an email account or mobile device using R in such a way that doesn't require a sender account input?
Example usage: to inform user when code is done running.
I've seen other SO posts discussing how to send emails (e.g., here and here) and texts via R, but none of these sources discusses the possibility of doing so without providing an explicit sender account (i.e, credentials).
Disclaimer:
This is not for sneaky business, but rather to simplify security/privacy.

Mechanism behind QR code scanning of WhatsApp web/desktop app

I could not find any answers related to the working mechanism of QR code scanning used on WhatsApp Web.
How does the authentication happen when the phone (any smartphone running WhatsApp) scans the QR code on the browser.
I don't want to know about the technology stack behind them. Like WhatsApp uses modified version of xmpp, uses erlang, uses web technologies like socket.io and ajax for the web version to implement such functionality.
The question might be broad. But I am eager to know about the implementation behind it.
It works like this :
1- You open the following URL on your browser : https://web.whatsapp.com/
2- The Browser loads the page with all sorts of JS and CSS stuff , but also opens a WebSocket ( wss://w4.web.whatsapp.com/ws ) - Check this image :
2.1- Every 20000 milliseconds you see traffic on the WebSocket for a refresh on the QR code you have on you screen. This is sent by the Server to the Browser, throught the WebSocket (WS we call it from now onwards)
2.2- On each QR Code refresh received on the WS , your browser does a GET request for the new QR Code in BASE64 encode .
2.3 - Notice that this specific WS that the server has open between the Server and the Browser is associated with the unique QR code !!! So, knowing the QR code, the server knows which WS is associated with it!
---- At this stage your browser is ready do the WhatsApp App work , but it does not know what is your ID (Whatsapp identifier which is your mobile number) , because it can't really get you phone number from thin air .
It also does not require you to type it, because the server wouldn't be sure that the number really belongs to you .
So, to let the Servers know that the WS session belongs to a specific phone, you need to use the phone for QR reading
3- You grab your phone, which is authenticated (otherwise you wouldn't have access to the section to scan QR codes) , and do the QR Code reading thing
4- When your mobile reads the QR code, it contacts the WhatsApp servers and tells them : My number is XXXX , My auth creds are YYYYY , and the WS associated with this QR code can now receive my DATA
5- The server now knows that it can direct Traffic to the specific WS socket that belongs to that QR Code, and does so !
6- On the Browser WS you can see the Server sending data regarding the user, regarding the conversations that you are having and which photo thumbnails to go and Grab.
7- The Browser gets this data from the WebSocket , and makes the corresponding GET requests to get the Thumbs, and other resources it needs, like an MP3 for notifications
7.1 - The WS listener on the Browser also makes Javascript calls, on the javascript files that were received at step 1 , to redraw the page DOM with the new interface .
8- The interface is now redraw to look like the WhatsApp app , and you continue to receive data on the WS , and sending when needed, and updates are made to the interface as data is arriving on the WS .
That is it.
Using Chrome, and Developer tools , you can see all this happening live. You can also see the WS communication (most of it, the binary frames you would need another tool ) and see what is happening all steps of the way.
Also:
Check a complete Tutorial on this : HERE
Source code for the Tutorial : Android Client
Source code for the Tutorial : Java Play Server
It uses something like below.
Whatsapp web application is opened by user via web browser.
Server creates a UNIQUE token (number) and embeds that number in QR-Code
Whatsapp phone application reads QR-Code and decodes token.
Whatsapp phone application sends information about its current user and this newly read token to whatsapp server.
Whatsapp server matches token (+ phone app user information) with web browser.
It automatically authenticates user and open new web page with his/her information on it.
there are two ways to implement QR login like whatsapp
Ajax polling
Websocket
I've made demos in php of
both
QR Login with Websocket
QR Login with Ajax polling
Note: Websocket apporach requires 2 port, one for main app and other for listening websocket connection.
Http server and websocket server can run on same port too with some proxy or some other way.
I found an example in nodejs too
QR login Websocket with nodejs

Sending attachment using AWS SNS(Simple Notification Service)

I am using AWS SNS for sending alert emails. Now the email content is really long therefore I wish to send it as a file attachment rather than sending it as a email content. Can this be done using SNS ?
No, it can't.
The SNS FAQ does not come out and explain this explicitly, but it can be inferred from several statements:
Amazon SNS messages can contain up to 256 KB of text data, including XML, JSON and unformatted text.
The ”Email” transport is meant for end-users/consumers and notifications are regular, text-based messages which are easily readable.
In addition, since you do not have access to the email header space when publishing to SNS, it is not possible to specify the necessary multipart coding for an email client to decide an embedded attachment. You can't even send HTML emails (well, you could, but a standards-conforming email client would not render them as HTML).
Now, many email clients will theoretically recognize http://... in an email body and turn them into clickable links, allowing you to link to the desired file... but that of course is not the same thing as attaching files.
I there does not appear to be a mechanism for attaching files to emails in SNS.

Resources