use keys similar to ssh does with public/private
This means authentication of the sender and recipient by letting each of these prove that they have access to the private key matching the accepted public key. This is essentially done by having on party create a challenge and the other party sign this challenge with the private key. This of course requires bidirectional communication which is against your requirement of one-way communication.
But, if you skip the "similar to ssh" you can use other established methods for one-way communication. A typical example for such methods is end-to-end encryption in mail, which is also one-way. Established protocols in this area are PGP and S/MIME which basically work like this:
- Sender signs the message with its own private key, where the public key is known to the recipient.
- Sender encrypts the (signed) message with the recipients public key. The encryption should of course involve also integrity protection (using an additional HMAC or authenticated encryption). And as usual the public key is not used to encrypt the whole message but this is instead done with a randomly generated symmetric key which is then protected (i.e. encrypted) with the public key.
Once the message is signed and encrypted without involvement of the recipient the message can be send over whatever unidirectional channel you want, i.e. UDP, data diode, avian carrier or whatever. There is no communication back from the recipient needed but of course the sender will never know if the recipient actually received the message.
Please note that this schema does not provide any forward secrecy, i.e. if the recipients private key is compromised all messages encrypted for this key (current, previous and future) can be decrypted. I don't think it is possible to provide forward secrecy with a pure one-way scheme though, but you might check this with the crypto experts at crypto.stackexchange.com.
A
is only one way to NodeB