<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Zheng "Bruce" Li</title>
    <description>The latest articles on Forem by Zheng "Bruce" Li (@zbruceli).</description>
    <link>https://forem.com/zbruceli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F348230%2F37d097a2-7425-4f08-8deb-b1782c79d433.jpeg</url>
      <title>Forem: Zheng "Bruce" Li</title>
      <link>https://forem.com/zbruceli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/zbruceli"/>
    <language>en</language>
    <item>
      <title>P2P on steroids - Meet Surge</title>
      <dc:creator>Zheng "Bruce" Li</dc:creator>
      <pubDate>Tue, 08 Dec 2020 17:29:06 +0000</pubDate>
      <link>https://forem.com/zbruceli/p2p-on-steroids-meet-surge-49mi</link>
      <guid>https://forem.com/zbruceli/p2p-on-steroids-meet-surge-49mi</guid>
      <description>&lt;p&gt;Surge is a new alternative to Bit Torrent, claiming to be 100% secure, 100% decentralized, and 100% anonymous. And the client and network are both 100% open sourced and owned by the community: so full transparency and no adware or malware. It has a modern and sleek user interface, and very fast in downloading large files across the globe. Please give it a try! :-)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://surge.rule110.io/"&gt;https://surge.rule110.io/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>security</category>
      <category>filesharing</category>
      <category>p2p</category>
    </item>
    <item>
      <title>nMobile: the extra secure, sever-less and trusted chat app</title>
      <dc:creator>Zheng "Bruce" Li</dc:creator>
      <pubDate>Tue, 04 Aug 2020 17:20:13 +0000</pubDate>
      <link>https://forem.com/zbruceli/nmobile-the-extra-secure-sever-less-and-trusted-chat-app-284</link>
      <guid>https://forem.com/zbruceli/nmobile-the-extra-secure-sever-less-and-trusted-chat-app-284</guid>
      <description>&lt;p&gt;“The decisions we make about communication security today will determine the kind of society we live in tomorrow.” by Whitfield Diffie. Launching nMobile 1.0, the extra secure, trusted and server-less chat app powered by blockchain tech.&lt;br&gt;
&lt;a href="https://blog.nkn.org/nmobile-the-trusted-chat/"&gt;https://blog.nkn.org/nmobile-the-trusted-chat/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>privacy</category>
      <category>messaging</category>
      <category>snapchat</category>
    </item>
    <item>
      <title>Encrypted Stream for net.Conn or io.ReadWriter</title>
      <dc:creator>Zheng "Bruce" Li</dc:creator>
      <pubDate>Wed, 03 Jun 2020 20:41:10 +0000</pubDate>
      <link>https://forem.com/nknorg/encrypted-stream-for-net-conn-or-io-readwriter-3d44</link>
      <guid>https://forem.com/nknorg/encrypted-stream-for-net-conn-or-io-readwriter-3d44</guid>
      <description>&lt;p&gt;It's surprising to find that no Golang library can easily transform a &lt;code&gt;net.Conn&lt;/code&gt; to an encrypted and/or authenticated &lt;code&gt;net.Conn&lt;/code&gt;. So I wrote one that works in one line, welcome to give it a try!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/nknorg/encrypted-stream"&gt;https://github.com/nknorg/encrypted-stream&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Encrypted-stream is a Golang library that transforms any &lt;code&gt;net.Conn&lt;/code&gt; or &lt;code&gt;io.ReadWriter&lt;/code&gt; stream to an encrypted and/or authenticated stream.&lt;/p&gt;

&lt;p&gt;The encrypted stream implements &lt;code&gt;net.Conn&lt;/code&gt; and &lt;code&gt;io.ReadWriter&lt;/code&gt; and can be used as drop-in replacement.&lt;/p&gt;

&lt;p&gt;Works with any encryption, authentication, or authenticated encryption algorithm or even arbitrary transformation. Only a cipher that implements encrypt/decrypt needs to be provided. XSalsa20-Poly1305 and AES-GCM are provided as reference cipher.&lt;/p&gt;

&lt;p&gt;The encrypted stream only adds a small constant memory overhead compared to the original stream.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Assume you have a net.Conn and you want to transform it into an encrypted net.Conn:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;conn, err := net.Dial("tcp", "host:port")&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;You first need to have a shared key at both side of the connection, (e.g. derived from key exchange algorithm, or pre-determined). Then all you need to do is to choose or implements a cipher:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;encryptedConn, err := stream.NewEncryptedStream(conn, &amp;amp;stream.Config{&lt;br&gt;
  Cipher: stream.NewXSalsa20Poly1305Cipher(&amp;amp;key),&lt;br&gt;
})&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Now you can use encryptedConn just like conn, but everything is encrypted and authenticated.&lt;/p&gt;

&lt;p&gt;See stream_test.go for complete example and benchmark with TCP connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benchmark
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ go test -v -bench=. -run=^$
goos: darwin
goarch: amd64
pkg: github.com/nknorg/encrypted-stream
BenchmarkPipeXSalsa20Poly1305-12            4712        254008 ns/op     516.01 MB/s           1 B/op          0 allocs/op
BenchmarkPipeAESGCM128-12                  18675         65688 ns/op    1995.38 MB/s           0 B/op          0 allocs/op
BenchmarkPipeAESGCM256-12                  16060         74029 ns/op    1770.55 MB/s           0 B/op          0 allocs/op
BenchmarkTCPXSalsa20Poly1305-12             6760        263446 ns/op     497.53 MB/s           0 B/op          0 allocs/op
BenchmarkTCPAESGCM128-12                   14780         82979 ns/op    1579.57 MB/s           0 B/op          0 allocs/op
BenchmarkTCPAESGCM256-12                   13321         92393 ns/op    1418.64 MB/s           0 B/op          0 allocs/op
PASS
ok      github.com/nknorg/encrypted-stream  9.471s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>go</category>
      <category>github</category>
      <category>encryption</category>
      <category>security</category>
    </item>
    <item>
      <title>NKN SDK: powering client side communication without servers</title>
      <dc:creator>Zheng "Bruce" Li</dc:creator>
      <pubDate>Wed, 25 Mar 2020 17:31:01 +0000</pubDate>
      <link>https://forem.com/nknorg/nkn-sdk-powering-client-side-communication-without-servers-4c7l</link>
      <guid>https://forem.com/nknorg/nkn-sdk-powering-client-side-communication-without-servers-4c7l</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CGnLcS4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.nkn.org/wp-content/uploads/2020/03/NKN-Github-scaled.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CGnLcS4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.nkn.org/wp-content/uploads/2020/03/NKN-Github-scaled.jpg" alt="NKN GitHub SDK"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What can developers do with NKN’s latest SDK, a decentralized communication stack that enables true peer to peer messaging, streaming, and file transfer? We would like to sort them into two main categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Things you can do &lt;strong&gt;&lt;span&gt;&lt;span&gt;ONLY&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt; with NKN SDK.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send and receive data for free between any NKN powered apps regardless of their network condition without setting up a server or relying on any third party services.&lt;/li&gt;
&lt;li&gt;Network agnostic: Neither sender nor receiver needs to have public IP address or port forwarding. NKN powered apps only establish outbound (websocket) connections, so Internet access is all they need. This is ideal for client side peer to peer communication.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Things you can do &lt;strong&gt;&lt;span&gt;&lt;span&gt;BETTER&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt; with NKN SDK&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Top level security: All data are end to end authenticated and encrypted. No one else in the world except sender and receiver can see or modify the content of the data. The same public key is used for both routing and encryption, eliminating the possibility of man in the middle attack.&lt;/li&gt;
&lt;li&gt;Decent performance: By aggregating multiple overlay paths concurrently, NKN  powered apps can get ~100ms end to end latency and 10+mbps end to end session throughput between most international locations. This might sound modest, but it is actually faster than most file transfer services (e.g. instant messenger, gmail/google-drive, wetransfer.com, or dropbox)&lt;/li&gt;
&lt;li&gt;Everything is free, open source and decentralized.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NKN recently combined three Javascript SDKs (client, multi-client and wallet) into a single one, and added several important new features that developers will love. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://github.com/nknorg/nkn-sdk-js#client"&gt;NKN Client&lt;/a&gt;: Send and receive data for free between any NKN clients regardless their network condition without setting up a server or relying on any third party services. Data are end to end encrypted by default. Typically you might want to use &lt;a href="https://github.com/nknorg/nkn-sdk-js#multiclient"&gt;multiclient&lt;/a&gt; instead of using client directly.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/nknorg/nkn-sdk-js#multiclient"&gt;NKN MultiClient&lt;/a&gt;: Send and receive data using multiple NKN clients concurrently to improve reliability and latency. In addition, it supports session mode, a reliable streaming protocol similar to TCP based on &lt;a href="https://github.com/nknorg/ncp-js"&gt;ncp&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/nknorg/nkn-sdk-js#wallet"&gt;NKN Wallet&lt;/a&gt;: Wallet SDK for &lt;a href="https://github.com/nknorg/nkn"&gt;NKN blockchain&lt;/a&gt;. It can be used to create wallet, transfer token to NKN wallet address, register name, subscribe to topic, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Several example applications that are built on NKN SDK are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  nMobile: a secure mobile wallet and chat application.

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://nmobile.nkn.org"&gt;More information&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://play.google.com/store/apps/details?id=org.nkn.mobile.app"&gt;Google Play Store download&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;  D-Chat: a decentralized chat as Chrome/Firefox browser extension.

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://forum.nkn.org/t/d-chat/1036"&gt;More information&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gitlab.com/losnappas/d-chat"&gt;Gitlab&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;  nFTP: a high throughput and direct file transfer between any clients

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://forum.nkn.org/t/nkn-d-ftp-high-throughput-file-transfer-using-nkn-client/1711"&gt;More information&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://nftp.nkn.org"&gt;Experience web app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/nknorg/nkn-file-transfer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So if your application needs these unique communication capabilities of NKN, would like to simplify and get rid of the servers, or simply to reduce server costs, you can head to NKN’s Developer Portal as well as our github repository to get started:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.nkn.org/developer/"&gt;https://www.nkn.org/developer/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/nknorg/nkn-sdk-js"&gt;https://github.com/nknorg/nkn-sdk-js&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>security</category>
      <category>webdev</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
