Is {Bluetooth on mobile phone} a reliable protocol for transmitting encrypted text?

I am developing a secure instant messaging chat solution, here is the scenario:

I need to encrypt my message and then send it to {Whatsapp, telegram, Wechat, …}, I don't trust any of the above software, so I use an application on my cellphone to encrypt / decrypt messages, basically it works like a translator.

However, the first idea turns out to be naive, since it is really difficult to make sure that the cell phone itself is not hacked, for example the clipboard.

Therefore, the current idea is to use a dedicated cell phone to encrypt and decrypt messages and transmit / receive messages with my cell phone (the one running instant messaging apps) via Bluetooth. The goal is to isolate the material that possibly contacts the original text, so that my cell phone can only read encrypted messages.

Is Bluetooth here a good solution?

The following image shows the rough idea. The A-1 and B1 phones must install only the encryption apps and remain offline for all types of connections, except for the Bluetooth connection with A-2 and B-2.

A typical process of sending and receiving messages

python – Nmap does not return network protocol

I play with Nmap in Python and after executing these commands:

import nmap

nm = nmap.PortScanner()
nm.all_hosts()  # returns
nm('').all_protocols() #  returns an empty list ()

I thought the network protocol should always be TCP or UDP
but how can i get anything from Nmap?

mining pools – Stratum Protocol – python implementation problem

For a few days, I try to write a simple python script to communicate with the stratum pool server. I use the simplified code of NightMiner ( and some testnet that I have foud (stratum + tcp: // 4008), but i can't get the right result. Maybe someone more experienced could help me. Below, I show each step of my script (step, no python source code).

1. connect to the server, authorize, get the job data

After connecting to the server, I send these requests:

b'{"id": 1, "method": "mining.subscribe", "params": ()}n'
b'{"params": ("testuser", "anything"), "id": 2, "method": "mining.authorize"}n'

and get the following answer:


2. collect the base and the merkle root

With this data and extranounce = & # 39; 00000000 & # 39; i can build the coinbase (as bytes, but i will show as hex in this example):


The next thing to do is double the base with SHA256 algo, which gives the following bytes:


There are no merkle branches (the merkle branch table is empty), so the hash above is our merkle root.

3. build the header

With the root merkle and the data received in step 1, I can start creating a header:

header= version + prevhash + merkle root + ntime + nbits + nounce

I use the values ​​as follows:

version - received '20000000', after little-endian conversion it is '0000002'
prevhash - received '21039cb098cb473758861d7c0ea32145df033e6c008dacad0000022200000000', after conversion it is 'b09c03213747cb987c1d86584521a30e6c3e03dfadac8d002202000000000000' (reverse bytes order every 4 bytes)
merkle root - get '490120573a2a22195de5f6d457026b15da1f205d372d474ec14dbf2875eb44e1' in step 2, stays that way
ntime - received '5e13824a', after conversion it is '4a82135e'
nbits - received '1a03550b', after conversion it is '0b55031a'

So the header is

b'00000020b09c03213747cb987c1d86584521a30e6c3e03dfadac8d002202000000000000490120573a2a22195de5f6d457026b15da1f205d372d474ec14dbf2875eb44e14a82135e0b55031a' + nounce

4. search noun

the difficulty is 0.01, so my goal is


after some calculations i find these 4 bytes to use it as a noun:


so my full header is now


after double hashing with SHA256 algo and reverse byte order, I get this hash:


which is below my target, so "1c35d277" should be the right name.

5. submit noun

the last thing to do is to submit the results, so I send this request to the server:

b'{"id":2, "method":"mining.submit","params":("testuser","53b5","00000000","5e13824a","1c35d277")}n'

and here is the answer I get:


I don't know why I get result = false. I can only assume that there is an error in step 3 (constructing the header) and this error is related to the byte order of some values, but i can't find this error (i have tried many byte variants, but i never got the result of answer = true).

I will be very obliged if someone could verify these calculations and give me some advice.

network – Why do all capture packets have 802.11 protocol and broadcast destination?

I am new to networking and packet sniffing. I have WireShark installed on my Ubuntu machine. I capture packets but they all have 802.11 as their protocol and broadcast destination. I activated promiscuous mode and I put my network interface in monitor mode using airmon-ng check kill then airmon-ng start wls1. I'm listening to wls1mon on Wirehark. I don't know what causes this. I also tried to be on the same network as my test PC. But when I do that, I don't capture packets even if the PC is on YouTube and the traffic is coming. I have tried with tshark and it is the same problem. When I watched a few videos on YouTube on this, they all captured packets with different protocols. However, did I not care if they were in monitor or managed mode? Can anyone help me? What am i doing wrong?

Google Sheets: insert non-http protocol link?

I am using the Chrome extension Buddy session to store browsing sessions. In this case, I saved a few windows with tabs on a search I just did but will read later.

So, on a sheet where I keep notes to read later, I would like to link this sheet to this recorded session, to reload it easily when time permits.

So the link I want to insert is:
=hyperlink("chrome-extension://edacconmaakjimmfgnblocblbcdcpbko/main.html#VDNNy652XdoPqvxr6QKLfnZ6hyhHzM0M","My link label")

The sheets will not treat this as a valid link, they will not produce a link (just text). And say The link does not appear to be correct. Typo? if i use the link input form. I only guess http are protocol links supported?

Workaround ?: Maybe, although hacky, use some sort of proxy / url rewrite technique? I am a web developer, so I could implement this type of hacking, just say if my proxy / router sees a link like http://my-url-change/link123 would it rewrite (locally, on my local network) on one of my desired non http links (such as file: //, etc.)? Does that make sense, anyone? If so, I will try this and share the results here.

swift – iOS: configuring the appearance and layout of the user interface, using the protocol to extract common code

There are many side controllers in my project, like the following pictures.
They share the same appearance and the same arrangement of the head view.



Use the protocol to extract the common code.

protocol SideHeaderDelegate: class {

    var h: SideHeader{ get set }
    var view: UIView! {get}
    var follow: UIView {get}

    func back()

Use the protocol extension to extract the common layout code.

extension SideHeaderDelegate{

    func doLayout(_ offset: CGFloat = 0){
        let top: CGFloat = 40
        h.translatesAutoresizingMaskIntoConstraints = false
        follow.translatesAutoresizingMaskIntoConstraints = false
            h.topAnchor.constraint(equalTo: view.topAnchor),
            h.leadingAnchor.constraint(equalTo: view.leadingAnchor),
            h.trailingAnchor.constraint(equalTo: view.trailingAnchor),
            h.heightAnchor.constraint(equalToConstant: top)

            follow.topAnchor.constraint(equalTo: view.topAnchor, constant: top),
            follow.leadingAnchor.constraint(equalTo: view.leadingAnchor),
            follow.trailingAnchor.constraint(equalTo: view.trailingAnchor),
            follow.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: offset)



Code of the common appearance of the head:

class SideHeader: UIView {

    weak var delegate: SideHeaderDelegate?

    let title: String
    let avatar: String

    lazy var headline = { () -> UILabel in
        let lbl = UILabel()
        lbl.textAlignment = .center
        lbl.text = title
        return lbl

    lazy var arrow = { () -> UIImageView in
        let img = UIImageView()
        img.image = UIImage(named: avatar)
        img.isUserInteractionEnabled = true
        return img

    let line: UIView = {
        let string = UIView()
        string.backgroundColor = UIColor(rgb: 0xD8D8D8)
        return string

    init(title name: String, icon: String = "mine_fork") {
        title = name
        avatar = icon
        backgroundColor = UIColor.white
        headline.translatesAutoresizingMaskIntoConstraints = false
        arrow.translatesAutoresizingMaskIntoConstraints = false
        line.translatesAutoresizingMaskIntoConstraints = false


            headline.centerXAnchor.constraint(equalTo: centerXAnchor),
            headline.topAnchor.constraint(equalTo: topAnchor, constant: 10)

            arrow.centerYAnchor.constraint(equalTo: centerYAnchor),
            arrow.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 8),
            arrow.widthAnchor.constraint(equalToConstant: 26),
            arrow.heightAnchor.constraint(equalToConstant: 26)

            line.bottomAnchor.constraint(equalTo: bottomAnchor),
            line.leadingAnchor.constraint(equalTo: leadingAnchor),
            line.trailingAnchor.constraint(equalTo: trailingAnchor),
            line.heightAnchor.constraint(equalToConstant: 1)

        let tap = UITapGestureRecognizer()
        tap.addTarget(self, action: #selector(SideHeader.pop))

    func change(title name: String){
        headline.text = name

    func pop(){

Use Code:

a controller instance

class VIPCenterCtrl: UIViewController, SideHeaderDelegate {

    lazy var follow: UIView = { () -> UITableView in
        let tb = UITableView(frame:, style: UITableView.Style.grouped)
        tb.register(for: VIPCenterCell.self)
        tb.separatorStyle = .none
        tb.delegate = self
        tb.dataSource = self
        return tb

    lazy var h = { () -> SideHeader in
        let head = SideHeader(title: "VIP 中心")
        head.delegate = self
        return head

    override func viewDidLoad() {
        // ...

    func refresh(){
         // ... 
         let vCenter = self.follow as! UITableView

I want suggestions. Do it faster.

The data refresh part is not very elegant. I need to launch it first, to UIView at UITableView

More code on github

You wonder why my Pi Pi VPN server (PiVPN) can only use the TCP protocol but not the UDP protocol

I need to create a personal VPN server using PiVPN with my Raspberry Pi 3B + (Raspbian Jessie). I make my server according to this guide:

I follow the instructions until I have a problem. The guide says that I must choose UDP (port 1194) to configure my server, redirect the same port with the same protocol. But when I use the VPN file with OpenVPN, I cannot connect to the Internet. I am trying to reconfigure each time I see a message trying to change the protocol to TCP and the port to 443x (x is a random number). And guess what! It worked. I am still using the TCP protocol so far but recently I saw a post on this community:

What is the difference between VPN over TCP and UDP?

I found that the VPN server prefers UDP to TCP.

Can someone explain to me why I encountered this problem?

Which Bluetooth iOS audio protocol does it use for Airpods?

I recently purchased the ToothFairy app and noticed that it had an option to activate the AAC codec. The difference in sound quality is remarkable.

Now I wonder:

  • What iOS protocol does it use?
  • How do I know which one is being used?
  • Is there a way to activate AAFC?

transactions – Bitcoin Protocol and Wiershark

I have captured Bitcoin protocol communication in real time and it is present in fig1 and fig2.

Fig. 1
enter the description of the image here

In the red box, there are many types of orders.

First question:

How can Wireshark detect bitcoin communications and analyze them? I think
the packet the socket sends may have something I do not know.

In the red box of fig2, you can see many package properties. this is clearly defined by the software, not by the hardware technique such as the router. The actual data that the client sends is actually hexadecimal data encoded by a specific rule.

Second question:

How can Wireshark analyze the data received? The Bitcoin client can parse it because it knows the rule, but Wireshark does not know anything because Wireshark is a third-party program, which has no relation to the Bitcoin software.

enter the description of the image here

Sorry for my English.

Reflection process on the network protocol attack

I am preparing for an introductory exam in information security at the university and this is one of the questions of the tutorial on network protocol attacks. I tried (a) and came to this conclusion:
Since EPbX () is a public-key encryption operation, C can decrypt any encrypted message to retrieve its original message, as it was from a person who is a member of the pair exchanging messages.

However, when I reread the question, decryption requires the use of private keys, which means that it might be impossible to get the message unless C is passed for the other in A and B, and participate in the key exchange. generate 2 pairs of private keys, which seems repetitive. This confusion prevents me from doing the last part (b).

Can any one suggest the thought process and solution to the problem above?

Here is the description of the question. Sorry, the paper document is not formatted to allow copying.

Webatk 1

webatk 2