Code Monkey home page Code Monkey logo

cyphertextkit's Introduction

CypherTextKit is a framework for establishing end-to-end encrypted communication between two users. It supports multiple devices per user, features encryption at rest and peer-to-peer networking. CypherTextKit currently targets iOS 15+ and macOS 12+, but can also run on Linux using Swift 5.5 or later.

The SDK is designed so that it can be easily implemented in existing communication apps. This allows you to re-use your existing iOS and backend code, but still provide a more secure and private communication experience.

Read the Story or Join our Discord for any questions and friendly banter.

Transparent End-to-end Encryption

CypherTextKit aims to be a layer inbetween your existing messaging traffic and database storage. All encryption happens within the framework, relieving your client logic from the hard work and bugs that can occur. You can also leverage the framework for signing custom information or encrypted on-disk storage.

Example Implementation

We provide an Example Client (iOS, macOS & CLI) as well as an Example Server. You can use these to start experimenting with CypherTextKit, or as an example for your own creations!

CypherTextKit demonstrates itself through a chat client, but it can also be applied to other communication. Think of the following examples:

  • End-to-End Encrypted Email Clients
  • Secret Messages over Printed QR Codes
  • VOIP Communication

Android & Windows

We've designed CypherTextKit based on Swift 5.5 using Server-Side Swift tools such as SwiftNIO so that it can be ported to both Android and Windows. Any contributions or collaboration towards such an effort is welcome, and we're already planning it out.

cyphertextkit's People

Contributors

joannis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

needle-tail mkll

cyphertextkit's Issues

Group Chat Helpers

  • Invite
  • Accept Invite
  • Decline Invite
  • Leave Group
  • Kick form Group
  • Send Magic Packets when changing the Group Config
  • Send a magic packet to inform other users

Synchronisation Strategy:

  • Synchronise using the framework from #29
  • Most Recent
  • Last Known

Conversation ID in Message Object?

Track a conversation ID in messages during transport. Messages from old conversation IDs (before a rekey occurred) can then be ignored, not triggering a new rekey.

The conversation ID could then also be used as the 'public information' when generating an initial key using HDKF

TupleMessage

Add support for tuple messages. When multiple messages are to be sent to the same device, we can bundle them together in a single packet.

Friendship Helper

Friendship

  • Block Users
  • Add as Friend
  • Remove as Friend
  • Block & Unblock
  • Can Ignore group communication by blocked users
  • Can prevent sending disallowed messages

Block

  • Client-Side Support
  • Server-Side Support
  • Disable Push by non-Friends (Server)
  • Client-Side Transport Hook (notify Server)

Tests

Test 1

When FriendshipRuleset.ignoreWhenUndecided == true, block all plugins down the line from communication.

  1. Create chat
  2. Don't add friends
  3. Send message(s)
  4. Neither Side sees the message, sender fails to send

Test 2

When FriendshipRuleset.blockAffectsGroupChats == true, doesn't block normal group communication

  1. Create group chat
  2. Start chatting
  3. Both parties can chat normally in the group

Test 3

FriendshipRuleset.blockAffectsGroupChats == true blocks blocked users

  1. Create group chat
  2. Start chatting
  3. Both parties can chat normally in the group
  4. Either party blocks the other
  5. New group messages don't arrive

Test 4

With FriendshipRuleset.ignoreWhenUndecided == true

  1. Create chat
  2. Add friends
  3. Chatting works
  4. User A blocks user B
  5. Can't chat
  6. User B blocks User A
  7. Can't chat still
  8. Both parties unblock each other (don't explicitly reclaim friendship)
  9. Parties resume chatting normally

Test 5

With FriendshipRuleset.canIgnoreMagicPackets == true and custom plugin

  1. Create chat
  2. Add friends
  3. A sends Magic packet using custom plugin
  4. B's plugin receives message
  5. A blocks B
  6. A sends Magic packet using custom plugin
  7. B's plugin doesn't receive it

Test 5

With FriendshipRuleset.canIgnoreMagicPackets == false and custom plugin

  1. Create chat
  2. Add friends
  3. A sends Magic packet using custom plugin
  4. B's plugin receives message
  5. A blocks B
  6. A sends Magic packet using custom plugin
  7. B's plugin receives message

Machine Learning Tests

  • Try to train the ML algorithm to recognise packet types
  • Try to train ML so that it reduces application 'health'
  • Measure application 'health'

Distributed State Framework

  • Preferences & Settings
  • Contact metadata
  • Chat metadata
  • Changes are timestamped

Data is synchronised with the master device, which relays the latest state onto other devices.

Test 1

  1. Master is offline
  2. Non-Master Client Changes State
  3. Other Non-Master Changes State
  4. Devices are out-of-sync
  5. Master comes online
  6. Devices are all in sync

Test 2

  1. Master is online
  2. Non-Master Client Changes State
  3. Other Non-Master Changes State
  4. Devices are all using the most recent state

Test 3

  1. All devices are offline
  2. Non-Master Client (A) Changes State
  3. Other Non-Master (B) Changes State
  4. B comes online and synchronises state with Master
  5. A comes online and synchronises state with Master
  6. B's state remains in place, as it's most recent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.