Giter Site home page Giter Site logo

christophhagen / libsignal-protocol-swift Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 18.0 521 KB

A Swift wrapper framework for libsignal-protocol-c

HTML 41.53% CSS 1.00% JavaScript 0.12% Swift 5.51% C 47.58% Objective-C 3.64% C++ 0.57% Ruby 0.05%
swift framework end-to-end-encryption wrapper messaging

libsignal-protocol-swift's Issues

Xcode 10 Beta 6 Compiling Issue

Compiling the framework with Xcode 10 Beta 6 does not work. I'm getting the following error: Command CompileSwiftSources failed with a nonzero exit code. In order to reproduce the error just download the framework and try to build it.

How can I solve this issue?

Legacy Version

Hello,

Is there any way to support old version of signal?. I am getting legacyMessage error.

GPLv3 License - Open Source?

The "libsignal-protocol-swift" uses the GPLv3 License. Does this mean I have to open source my closed source project when using this library?

If yes, do I have to open source the whole project or only parts of my code that use and interact with the library?

In decrypt I am getting error legacyMessage : Unsupported legacy version

Hi,

I've written a sample project using the library to encrypt and decrypt. While decrypting I am passing the message as below:
let message = "Hi, This is First Encrypt Message".data(using: .utf8)
let encryptedMessage = try cipher.encrypt(message!)
let encString = encryptedMessage.data.base64EncodedString()
Now at the decrypt
let encrData: Data = Data(base64Encoded: encString, options: .ignoreUnknownCharacters)!
let decryptedMessage = try cipher.decrypt(preKeySignalMessage: encrData)

I also tried out without the base64EncodedString. Then the code is as below:
let message = "Hi, This is First Encrypt Message".data(using: .utf8)
let encryptedMessage = try cipher.encrypt(message!)
let encString = encryptedMessage.data
Decrypt:
let decryptedMessage = try cipher.decrypt(preKeySignalMessage: encString)

I am getting the error : [WARNING] Unsupported legacy version: 0

Please help me out to resolve the issue.

Storing keys of recipient's.

I'm new to Swift so maybe this question is stupid, but here it is. Is there a method in this lib to save recipient's keys on a safe place when i receive them from server or shoud i write them my self?

GroupCipherTests

error: -[libsignal_protocol_swiftTests.GroupCipherTests testExample] : failed - Could no encrypt message noSession

Weird issue with encryption + `SignalAddress`

When encrypting a message the framework invokes its delegate stores in order to do some processing. This is done when invoking encrypt(_:) on a SessionCipher. In order to create a SessionCipher a remoteAddress is needed. Lets say we create the remoteAddress with let remoteAddress = SignalAddress(name: userId.description, deviceId: 1). Now when checking the values the remoteAddress contains (name + deviceId) I get the following correct values: userId = "1" and deviceId = 1.

Then something weird happens when encrypt(_:) is invoked. The first method that is invoked by the framework is loadSession(for:) - SessionStore. The loadSession(for:) method gets the remoteAddress as a parameter.

Now checking the values of the remoteAddress the method did receive the deviceId equals 1, but the name does not equal. Instead of getting "1" I get this: "1\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}Hrkt\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}U\u{ef}\u{ef}\u{ef}ݺ\u{ef}i"

Every time when encrypt(_:) is invoked the name of the address changes. But the string always starts with the original name (here "1").

I wrote some unit tests and when running non of them show this issue. This only happens on actually running the application on device or on simulator.

Here a picture of the original address that was handed over to the session cipher object:

bildschirmfoto 2018-04-27 um 21 23 32

And here the same address, that was handed over to the store delegates:

bildschirmfoto 2018-04-27 um 21 23 54

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.