Read legacy encrypted messages¶
When working with an older protocol that expects NIP-04 encryption, select it explicitly on the signer:
String ciphertext = signer.encrypt(
"legacy message", recipient,
NostrSigner.EncryptAlgo.NIP04).await();
String plaintext = signer.decrypt(
ciphertext, sender,
NostrSigner.EncryptAlgo.NIP04).await();
Tip
For new encrypted data, prefer NIP-44.