From what I remember you can’t sign with a public key, the idea of signing is only one source can do it and the public key is used to verify the signature.
This is the opposite way when encrypting which will use the public key to encrypt and the private key to read.
Encrypting with a public key makes more sense, At the moment our Crypto doesn’t support encrypting data so you would need to look at using the code node instead.
If it is a password though are you sure it wants the value encrypted and not hashed? Do you happen to have any links to the API docs?