Streaming encryption based on TweetNaCl.js