C# Encrypt string with public RSA-1280 hex key
问题 I've been trying to encrypt a password with a public RSA key that is sent to me by the server. var csp = new CspParameters(1, "Microsoft Strong Cryptographic Provider"); RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(1280, csp); byte[] key = ByteUtils.HexToBytes(client.RSAKey); RSA.ImportCspBlob(key); byte[] encrypted = RSA.Encrypt(Encoding.ASCII.GetBytes(password), true); The hex key is provided in such format: string key =