Replying to Avatar 0xtr

I had a hard time implementing using the aes and cbc crates but got it working with https://crates.io/crates/libaes. This library hasn’t been audited in any way AFAIK so I have no idea if it’s safe to use.

It can be a temporary solution, do your implementation works for crypt and decrypt private messages?

Reply to this note

Please Login to reply.

Discussion

Yeah, just got decryption working

A good start!

I'm trying to encrypt with AES, really hard to test it... got "???" as private message :/

I have used parts of ok300s implementation for NIP-04 in https://github.com/ok300/nostr-rs/blob/master/src/util/nip04.rs as an example when trying to implement it in nostr_rust

Good idea, but beware, the ok300s implementation uses "deprecated" libraries

Yeah, I mentioned it in your DMs. His/her code still works but can’t use it because the crates are deprecated

I just tried MagicCrypt which is a good library I think, but it doesn't work either :(

I'm gonna try libaes

https://github.com/emeceve/loquaz has it in Rust, I don't know how they did it.

Which is based on obsolete libraries, I think I have solved almost all my problems but the only one that remains is the generation of the shared key which is not the same as on the nodejs library for example, and currently I will not be able to explain why

what obsolete libraries?

yup welcome to hell. took me awhile to get it working. making sure the shared secret is the same between different clients helped a lot.

Yes the Shared secret is the same between 2 "users"