You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
I am using RNCRyptorNative(version 0.0.9) at my android app, which have an iOS(swift) version too.
I have a chat which all messages sended are encrypted before save on my database.
Error decoding text: The operation couldn’t be completed. (RNCryptor.RNCryptor.Error error 2.)
The uncanny problem is that on Android, using your lib, i can decrypt every message that came from an iOS or Android.
On Android i am using the default implementation:
This is the following iOS code that are trying to decode android messages without success:
// Encryption
func EncryptText(myPassword: String, string: String) -> String {
let data = string.data(using: String.Encoding.utf8)
let encryptedData = RNCryptor.encrypt(data: data!, withPassword: myPassword)
return encryptedData.base64EncodedString(options: NSData.Base64EncodingOptions.init(rawValue: 0))
}
// Decryption
func DecryptText(chatRoomID: String, string: String) -> String {
let decryptor = RNCryptor.Decryptor(password: chatRoomID)
let encryptedData = NSData(base64Encoded: string, options:
NSData.Base64DecodingOptions(rawValue: 0))
var message: NSString = ""
do {
let decryptedData = try decryptor.decrypt(data: encryptedData! as Data)
message = NSString(data: decryptedData, encoding: String.Encoding.utf8.rawValue)!
} catch {
print("Error decoding text: (error)")
}
return message as String
}
I came with this issue here, because when i use JNCryptor on Android, iOS can decrypt my messages without any problem. I choose to use RNCryptorNative because of the huge performance gain.
Can you guys help me with that to try figure out whats happening?
Thanks and congrats for the lib!
Activity
giolegaspijr commentedon Aug 9, 2018
Hello @Senemix29 , Were you able to solve this issue? thanks!
Senemix29 commentedon Aug 25, 2018
@giolegaspijr i given up on this lib and move foward to another solutions without encryption =/