A call to System.Security.Cryptography.RSACryptoServiceProvider.Encrypt failed with this message: Invalid length.

Hi experts please need your help.

I receive this error when I try to perform encryption using my public key: A call to System.Security.Cryptography.RSACryptoServiceProvider.Encrypt failed with this message: Invalid length.

My code is written with AL code runtime 12, business central 2023 wave 2

How to solve the problem ??

THANKS