Apple release new API AVDepthData(A container for per-pixel distance or disparity information captured by compatible camera devices.) on iOS11 beta, it can use on iPhone 7 dual camera now.
2) port/tcp, udp attack top 20
イマドキtelnetかよ(w)的なツッコミをしたくなる。
3) attack country unique ip top 20
China 1076
Viet Nam 367
United States 334
Brazil 294
Korea, Republic of 274
Turkey 251
India 214
Taiwan, Province of China 210
Mexico 207
Russian Federation 196
Iran, Islamic Republic of 134
Argentina 101
Romania 86
Italy 80
France 78
Ukraine 75
Thailand 74
Australia 64
Poland 60
Colombia 60
I got a ESP32-S from US friend kaduhi. Thank you!! I will enjoy this exciting device and experiment/create codes:)
ESP32-S spec is here.
CPU : Xtensa® 32-bit LX6 Dua-core processor
ROM/SRAM: 448 KByte ROM, 520 KByte SRAM
WiFi : 802.11 b/g/n/e/i
Bluetooth : Bluetooth v4.2 BR/EDR and BLE
And others amazing spec is hardware accelerated encryption: AES / SHA2 / Elliptical Curve Cryptography / RSA-4096. This hardware encryption is very useful for IoT and TLS networking. I thinking ESP32 is powerful PC including networking spec.
cd /Applications/Arduino.app/Contents/Java
cd hardware
mkdir espressif
cd espressif
git clone https://github.com/espressif/arduino-esp32.git esp32
cd esp32/tools
python get.py
# pyserialを入れる。pyenvとかpipを使っている場合は、それに合わせて入れる
wget https://pypi.python.org/packages/1f/3b/ee6f354bcb1e28a7cd735be98f39ecf80554948284b41e9f7965951befa6/pyserial-3.2.1.tar.gz
tar -zxvf pyserial-3.2.1.tar.gz
cd pyserial-3.2.1
sudo python setup.py install
ESP32のスペックはざっくりだと。詳細はググると出てくるけど、本家のはこちら。
CPU : Xtensa® 32-bit LX6 Dua-core processor
ROM/SRAM: 448 KByte ROM, 520 KByte SRAM
WiFi : 802.11 b/g/n/e/i
Bluetooth : Bluetooth v4.2 BR/EDR and BLE
他には、RTC、そして自分的に凄いと思うのが、ハードウェア暗号化アクセラレーション。TLSが(実装すれば)サクッとつかえるー!!AES-HASH(SHA-2) library-RSA-ECC-Random Number Generator。凄い、これ凄い。言ってしまえばNWにつながる小さいPCっすね。
cd /Applications/Arduino.app/Contents/Java
cd hardware
mkdir espressif
cd espressif
git clone https://github.com/espressif/arduino-esp32.git esp32
cd esp32/tools
python get.py
# pyserialを入れる。pyenvとかpipを使っている場合は、それに合わせて入れる
wget https://pypi.python.org/packages/1f/3b/ee6f354bcb1e28a7cd735be98f39ecf80554948284b41e9f7965951befa6/pyserial-3.2.1.tar.gz
tar -zxvf pyserial-3.2.1.tar.gz
cd pyserial-3.2.1
sudo python setup.py install
I implement mbedTLS to the Particle environment community library, TlsTcpClient and MQTT-TLS. This 2 library could connect to AWS/Azure…etc IoT cloud platform with certificate/private key.
Now cipher suite is here.
TLS_RSA_WITH_AES_128_GCM_SHA1
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_AES_128_GCM_SHA512
TLS_RSA_WITH_AES_256_GCM_SHA1
TLS_RSA_WITH_AES_256_GCM_SHA256
TLS_RSA_WITH_AES_256_GCM_SHA512
Here is TLS 1.2 sequence.
I test this library with Particle Photon on the several IoT Platform(AWS IoT/Azure/mosquitto/eclipse iot…etc), I would note the “How to implements mbedTLS to embedded IoT platform”.
Here is the Particle Cloud API and MQTT(TLS)/TlsTcpClient network communications image.
Particle Cloud API is official API from Particle very useful for developer, it is easy to use on the application with Cloud IoT Platform and low price(free Device Cloud access for first 100 devices). But if Particle cloud system will down, device could not pub/sub data with other Cloud IoT Platforms. MQTT(TLS)/TlsTcpClient area community library could connect to the AWS/Azure…etc directly, developer could use this for second choice.
And Particle provid firmware api TCPClient for the TCP network communication. If developer want secure TCP connection, TlsTcpClient could be used for it.
Next, my point of the implementation of the Photon and mbedTLS.
1) I want to use OpenSSL on the Particle but can’t
OpenSSL is powerful SSL/TLS library used on the several application, server, pc…etc.(SSLSocket is very useful for programmer). Maybe talking about the SSL, many developer think OpenSSL. But OpenSSL library size is very fat. I build openssl-1.1.0c on my Ubuntu x64 total library size is 9,227,602byte!!
Then I found the following open source TLS library for implementation.
I choice the mbedTLS because of mbedTLS could use the Apache 2.0 license or the GPL 2.0 license, and I think the future possibilities with the this library.
mbedTLS could work on the several CPU(x86/64…etc) platform not only the ARM core. And Particle Photon have a STM32F205RGY6 120Mhz ARM Cortex M3, so maybe think “you could build/compile the mbedTLS on the Photon easily, hahaha…”. That’s fault. I did the following work.
1. There were very lot of compile error happen on the mbedTLS with Particle IDE, I modify source code and debug.
2. There are some libc function needed by mbedTLS did not found on the Particle environment, I added that functions to the mbedTLS source code.
2) embedded cpu power.
Particle Photon have a STM32F205RGY6 120Mhz ARM Cortex M3 cpu. This spec is powerful for embedded IoT platform, but I’m afraid TLS/RSA/some cipher alogorithm could not work on the this CPU spec. As a result, there is nothing to worry about that.
Photon with webserver TLS handshake total network time(see the this blog entry WireShark packet capture image) is under 20ms!! on the case of the TLS_RSA_AES_128_GCM_SHA256. And TLS data communication(AES128 cipher) encrypt/decrypt is high speed too. Photon cpu(Cortex-M3) is enough for TLS working!!
Next version Particle device ARGON(BT Mesh, WiFi) including ESP32 chip. ESP32 have a hardware acceleration AES/SHA-2/RSA/ECC/RNG maybe ARGON enable very fast TLS communication.
3) firmware size.
I think this firmware size limitation is really important. Here is MQTT-TLS a1-sample build result.
Application firmware size limit is about the 128Kbyte with library, so it’s hard to use a lot of library even if developer want to use. If library use 96Kbyte size in the application, developer could use only 32kbyte for own application. Because of that, library have to shape the size as far as possible for developer application.
mbedTLS library have a several Cipher Suites, option algorithm, which one be used is important for the size and security. Of course all cipher suite could include to the library, but library would be size over the flash size. On the other hand, if it use the weak cipher(DES/MD5) only for the flash size, that’s security would be vulnerable. Balance of the security and flash size would be very important.
Thne here is latest library size with sample application.
Now cipher is TLS_RSA_WITH_AES_[128|256]_GCM_SHA[1|256|512], if remove SHA1/512 size will be about 50Kbyte. I choice this cipher suite because of certification compatibility/security strength.
4) etc.
1st version TlsTcpClient/MQTT-TLS programing with mbedTLS is about 2-3 days. mbedTLS is very useful and having possibilities in IoT environments.
I think TLS would be more needed in IoT/embedded platforms. A lot of IoT/embedded platforms use non ciphered TCP communication now because of low power MCU/firmware size limitation, but mbedTLS works well like a this MQTT-TLS/TlcTcpClient library.
TlsTcpClient for Particle Photn, Now release version 0.1.0.
TLS TCP client library cloud not use on Particle Photon WebIDE, but NOW we can use TLS TCP simple client library based by mbedTLS. Here is sample source code. Developer can connect to every TLS web/server using that Root CA pem file.
まだ触りはじめの段階だけど、スイッチサイエンスさんがmicro:bit互換機のモニターを募集していて、勢いで応募してみたら…当たりました!! ちなみに、自分はクジ運とか一切ないです。宝くじは当たっても300円が最高とかだけど、なぜかこういう時に運を発動するようで…ありがとうございます!! Maker Faire Tokyoでも販売されるようで、期待度高いっす。
まず、micro:bitってなーに?という方はこちらを… BBCのMicro:bitがイギリスのすべての11歳と12歳の子どもたちに無料配布される BBCのMicro:bitは子どもたちにぴったりのプログラミング端末
英国でチビッコに無料!!で配られている端末で、これを使ってプログラミングの勉強をしたり遊んだり出来るというステキ端末です。LED、BLE、加速度センサ…etcが付いて無料!!無料っすよ。こういう物を配れるというのは、既に日本とは環境的にヤバイ違う感がするですね。
ちなみに、今年のMaker Faire Bay AreaでMicrosoftさんブースでmicro:bitを使ったワークショップか何かをやっていたり、日本では何で…?といった所は感じていたですね。
Bay AreaのMaker Faireはザックリだと世界各地のギークや、いわゆるシリコンバレー周辺のギークやらガレージで作った変な物(人)が集まって見せ合うイベントだと思われ。そしてちびっ子向けのワークショップや体験物があったり、KickStarter, Indiegogoといった所に出しているような新しいデバイスも大集合みたいな。ただ、フェス感はハンパない。そこら辺で音楽がなっていたり、展示やイベントが行われている。来場者数も半端無くて、13万人以上が一気に来る。実際会場は人・人・ひーーーーーとーーーー!!で溢れている。全体の会場はこんな感じ。