1

I want to decrypt some encrypted RSA payload at the anchor program. So I've tried to cargo add some RSA libraries such as rsa, ring, and openssl. But when I tried to build the anchor, it all failed. I think it's not supported for solana program. Is there a way to build these libraries for solana/anchor? How could I use RSA at the program?

1 Answer 1

1

Unfortunately, the answer is simple: you can't. Even if you manage to compile the crates, your program won't be able to perform decryption on-chain without going over the compute limit.

Any cryptographic operation must use the Solana platform syscalls. Here are some examples:

2
  • How could I use Solana platform syscalls? Could you give me the examples?
    – Jung Chun
    Commented Aug 16 at 6:11
  • I edited my answer to give examples
    – Jon C
    Commented Aug 16 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.