christophhagen / libsignal-protocol-swift Goto Github PK
View Code? Open in Web Editor NEWA Swift wrapper framework for libsignal-protocol-c
A Swift wrapper framework for libsignal-protocol-c
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?
Hello,
Is there any way to support old version of signal?. I am getting legacyMessage error.
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?
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.
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?
Should use MemoryLayout.size allocate memory
error: -[libsignal_protocol_swiftTests.GroupCipherTests testExample] : failed - Could no encrypt message noSession
does this single framework work on Debug and Release mode?
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:
And here the same address, that was handed over to the store delegates:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.