VirgilSecurity / virgil-e3kit-x

E3Kit is a security framework that simplifies work with Virgil services and presents the easiest way to add full end-to-end security to your chat application to become HIPAA and GDPR compliant and more.
https://virgilsecurity.com/e3kit/
Other
14 stars 7 forks source link

Virgil Decrypt Issue #75

Open AshirShaikh99 opened 1 year ago

AshirShaikh99 commented 1 year ago

Bug Description

I am facing this issue when the data is received and sent so it is not decrypted so here are the terminal logs mentioned below.

PlatformException(decrypt-failed, The operation couldn’t be completed. (VirgilCryptoFoundation.FoundationError error -303.), unknown error, null)

Expected behavior I want to decrypt the messages which I received and sent so they can be viewed in the view.

Screenshots

img

If you see the screenshot the messages are not decrypted and due to that, they are not viewed on the screen.

Devices Information

Additional context On the receiver and sender end, the messages are not decrypted, and due to that, they are not appearing in the view!

AshirShaikh99 commented 1 year ago

Any update on it?

behrad-kzm commented 1 year ago

I get the same error in this situation: Screenshot 2023-06-25 at 8 38 39 PM as you can see userCards and localPrivateKey loaded successfully.

the user registered with a device, I called backend private key and everything was ok. but when the same user login on new device. recipient messages will fail on decrypt and returns errorKeyRecipientIsNotFound error. Screenshot 2023-06-25 at 8 44 31 PM

why the decrypt method returns error?

this is the code I used to decrypt messages:

 if let sender = sender, let userCard = VirgilClient.userCards[sender] {

        return  try eThree.authDecrypt(text: text, from: userCard)

 }

I think I doesn't make any sense and maybe its a bug if I'm not doing something wrong.

sepehrafla commented 1 year ago

I got the same issue