opentrace-community / opentrace-android

OpenTrace Android app. Reference implementation of the BlueTrace protocol.
https://bluetrace.io
GNU General Public License v3.0
577 stars 223 forks source link

How to decrypt MSG #13

Closed ie76 closed 4 years ago

ie76 commented 4 years ago

Hello,

i have an issue decrypting the msg attribute once it's stored. i want to decrypted once i get the records in firestore.

Thanks

rinekri commented 4 years ago

@ie76 did you try a decryptTempID function? I think it should fit for this case, because msgs from firestore should contain temp ids generated by opposite function. I planned to use this approach in the near feature.

ie76 commented 4 years ago

Well yes i did, but i got a weird string when i used decodeAndDecrypt function. or should i use decodeAndDecrypt and then decryptTempID for msg attribute ?

rinekri commented 4 years ago

@ie76 I think, just decryptTempID should be enough, because it's returning json with userId and timestamp. Try to invoke only decryptTempID with msg argument and encryption key obtained from await getEncryptionKey().

ie76 commented 4 years ago

Thanks a lot for your help. it's worked perfectly ! Thanks again.

Hoangtho11188 commented 4 years ago

@ie76 can you help me on this?I'm still stuck at here :)

ie76 commented 4 years ago

@ie76 can you help me on this?I'm still stuck at here :)

You still cannot decrypt the msg ?

Hoangtho11188 commented 4 years ago

yes bro, could you pls help me on this?

ie76 commented 4 years ago

well are you using the nodejs backend too ? if yes there's a little function call decrypt, you can use it to decrypt your string with the private key. Easy

Hoangtho11188 commented 4 years ago

well are you using the nodejs backend too ? if yes there's a little function call decrypt, you can use it to decrypt your string with the private key. Easy

Yes, which function? Pls show me the way :)

ie76 commented 4 years ago

Sure. There's a file called CustomEncrypter.ts with a decryptTempID, you can find more decryptions. you can look there and i'm sure you are going to find a solution