How is Telegram encryption is poroprietary, yet their client is open-source?

It is often noted (for example in this question&answer) that one of the major flaws of the Telegram messenger is that it uses ‘proprietary‘ encryption instead of peer reviewed and open-source one. At the same time the source code of the app is open-source.

How is this possible that encryption algorithm is ‘proprietary‘ (i.e. close-sourced and can not be reviewed) and yet open-source client is somehow is able to decrypt received messages. To explain what I mean (assuming end-to-end encrypted secret chat): message sent from device A to device B, in order to be end-to-end encrypted must not left device A before it encrypted and must not be decrypted until it reaches device B (at least that is my current understanding), if so – algorithm of encyption/decription must be contained in the client itself, so, how then such encryption algorithm could be considered ‘proprietary‘? What am I missing here?

Can Google and Apple read Telegram notifications’s body?

When using e2e encryption (secret chats), the answer is obviously no (I hope), but I am talking about NOT e2e-encrypted messages, the ones stored in the cloud.

I am of course aware that the messages are travelling on SSL encrypted connections, but are the body of the messages encrypted in any way when they reach Google/Firebase Cloud Message, APN and other 3rd party push notifications services?

In other words, if I send a message to Bob over a NON-secret chat, can Google, Apple, etc. read the body of the message I sent to him when it passes through their push notifications servers or is it encrypted?

Как написать бота для – Whatsapp, как у Telegram, такое возможно?

Не совсем понятно, как это работает.

Находил один вариант через selenium, но при этом создать новые контакты через web.whatsapp – не нашел (или не возможно).

А также второй вариант, который увидел, но не увидел реализацию. Переходишь по ссылке, пишешь, в последующем сразу мне отвечает.

Кто знает, если не трудно можете помочь. Есть какая-нибудь статья или куда надо мне копать, чтобы разобраться?

Automatically checking argument types in commands of a Telegram bot

I am writing a simple Telegram bot in Python 3 using the python-telegram-bot library. I was not very happy with the ‘command handling’ provided by the library because this code is not beautiful at all and is very noisy:

def caps(update, context):     text_caps = ' '.join(context.args).upper(), text=text_caps)  caps_handler = CommandHandler('caps', caps) dispatcher.add_handler(caps_handler) 

So I wanted to create a more convenient way, and now a command looks like this:

@cmd('hello') def cmd_hello(msg, a:int, b:[float], c:str):     s = ''     s += 'Number: '+str(a)+'\n'     s += 'Floats: '+str(b)+'\n'     s += 'String: '+c     return s 

If i send this command: /hello 1 3.14 5 3.7 world to the bot, the response will be:

Number: 1 Floats: [3.14, 5.0, 3.7] String: world 

I am using the inspect module to read the argument annotations of a function and store them in a dict:

Cmd = namedtuple('Cmd',['func','patterns']) commands = dict()  def cmd(name):     def deco(func):         args = []         sig = signature(func)          for arg_name, param in sig.parameters.items():             ann = param.annotation             if ann:                 args.append(ann)             else:                 args.append(str)          args.pop(0)         commands[name] = Cmd(func, tuple(args))         return func     return deco 

The process_args function takes: 1) a list of raw (str) arguments that a bot receives in a message, 2) a list of patterns to match the arguments; and returns a list of processed (converted) arguments or raises CmdError if the arguments are incorrect.

def process_args(args, patterns):     patterns = list(patterns)      processed = []     while patterns:         if not args:             raise CmdError("Not enough arguments")          pattern = patterns.pop(0)          if pattern in (int, float, str):             arg = args[0]             try:                 converted = pattern(arg)             except Exception:                 raise CmdError(f"Cannot parse argument {arg} as {pattern.__name__}")             args.pop(0)             processed.append(converted)          elif isinstance(pattern, list):             pat_single = pattern[0]             collected = []              match = True             while match:                 try:                     x = process_args([args[0]], [pat_single])[0]                 except CmdError: # If the pattern isn't matched anymore                     match = False                 else:                     collected.append(x)                     args.pop(0)             processed.append(collected)      return processed 

This function looks really bad. Is there a better way of implementing a pattern matching like this?

Почему php script отправки сообщения в telegram срабатывает несколько раз?

Есть бот и php файл.
Я с telegram отправляю start.
В php скрипте ($ string_input = file_get_contents('php://input');) есть такая последовательность:

if ($  text=="start"){      sendMessage(1);      first($  connect);      sendMessage(2);      second($  connect);      sendMessage(3);      third($  connect);      sendMessage(4);  } 

И это последовательность работает неправильно. В телеграм сообщения отправляются:

       ~ start    1 2 3 4 1 3 2 4 1 3   2 1   4 . . . 

Каждая функция обрабатывается примерно по минуту. Если комментировать эти функции, то все хорошо работает. Поискал в интернете, думаю проблема в ответе, либо 200 или ok, но не помогло, или я не смог.

Помогите найти решение, а то уже несколько дней не могу понять…

telegram, slack, skype won’t run if I put them on startup applications

I have run telegram, slack, skype on startup application ubuntu 16.04

enter image description here

But, the icon doesn’t appear in taskbar (notification area). Howver, it appear as run application

 $   ps ax | grep skype  3854 ?        SLl    1:59 /usr/share/skypeforlinux/skypeforlinux --executed-from=/home/pujangga --pid=3847  3864 ?        S      0:00 /usr/share/skypeforlinux/skypeforlinux --type=zygote --no-sandbox  3985 ?        Sl     1:33 /usr/share/skypeforlinux/skypeforlinux --type=renderer --autoplay-policy=no-user-gesture-required --ms-disable-indexeddb-transaction-timeout --no-sandbox --service-pipe-token=EF831309DDA5DEFF9BDFE0351F93886A --lang=en-US --app-path=/usr/share/skypeforlinux/resources/app.asar --node-integration=false --webview-tag=true --no-sandbox --native-window-open --preload=/usr/share/skypeforlinux/resources/app.asar/Preload.js --background-color=#fff --num-raster-threads=4 --enable-main-frame-before-activation --enable-compositor-image-animations --service-request-channel-token=EF831309DDA5DEFF9BDFE0351F93886A --renderer-client-id=4 --shared-files=v8_context_snapshot_data:100,v8_natives_data:101 --skype-process-type=Main  9924 pts/16   S+     0:00 grep --color=auto skype 

When I try to run it unity dash, it won’t start too. I need to killall skypeforlinux to make it run through dash menu