rawr-x3dh icon indicating copy to clipboard operation
rawr-x3dh copied to clipboard

Fixed a few bugs that prevented encryption and decryption

Open zireal23 opened this issue 1 year ago • 0 comments

First of all, thank you for your awesome work with the library. We are currently trying to build an end to end encrypted document collaboration system much like google docs but with end to end encryption. I am looking into the encryption part and as such have been working with your library for the past few days. Initially there were few bugs that hindered encryption/decryption and as such I have tried fixing them. Bugs fixed:

  • Most of them were type errors that were fixed by explicitly defining the types or using type:any wherever required.
  • Added a code block that stored the X25119 keypair in the object because the private part was necessary during the shared key calculation process, wrote a function for that and added the function declaration in the exported IdentityKeyManager interface.
  • The function “saveIdentityKeyPair” wasn’t exported and as such wasn’t being used, so added the function signature to the exported interface.
  • Removed the slice function that was being used with the buffer types(since it is deprecated) and used the subarray function in its place.
  • The function “saveIdentityKeypair” was only saving the private part of the identity key, edited it to save both the public and private part.

Right now, the library is working correctly with the encryption and decryption. Please checkout the changes and merge the ones you deem fit.

zireal23 avatar Mar 15 '23 06:03 zireal23