Why Nostr? What is Njump?
hodlbod /
npub1jlr…ynqn
2024-02-15 01:25:43

hodlbod on Nostr: Ok I need some more help, ek mleku fiatjaf I'm trying to decrypt an event using ...

Ok I need some more help, ek (nprofile…8th3) mleku (nprofile…wr4h) fiatjaf (nprofile…9h9m)

I'm trying to decrypt an event using nip44, but I'm getting an "invalid hmac" warning on a valid payload (at least, according to the javascript implementation). Any hints? Code below.

func getNip44ConversationKey(sk string, pk string) []byte {
sk_bytes, _ := hex.DecodeString("02" + sk)
sk_obj := secp256k1.PrivKeyFromBytes(sk_bytes)
pk_bytes, _ := hex.DecodeString("02" + pk)
pk_obj, _ := secp256k1.ParsePubKey(pk_bytes)

return nip44.GenerateConversationKey(sk_obj, pk_obj)
}

func getNip44Rumor(sk string, wrap *nostr.Event) (*nostr.Event, error) {
wrap_key := getNip44ConversationKey(sk, wrap.PubKey)
nip44.Decrypt(wrap_key, wrap.Content) // invalid hmac

...
}
Author Public Key
npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn