CryptoRSAExample

In the example is this line of code: Dim msg As New MemoryBlock(14) where the (14) appears to control the number of characters. I have changed the number up to 85 and can get 85 characters to work including the decryption further in the code. However, if the value is increased above 85 the program crashes. Ids there a way to increase the value (shown above as 14) to some value over 200? I can’t seem to find a way to do this.

Thank you.

I don’t know why it would crash. You might try Xojo.Crypto.RSAEncrypt instead.

But keep in mind that what you are encrypting is meant to be small.

For more info: Using Public/Private Key Encryption

If I remember correctly, a given rsa key bit length can only encrypt a certain amount of data. Try changed the key length to a 2048 or 4096bit key.

Call Crypto.RSAGenerateKeyPair( 2048, privateKey, publicKey )

See my comment in the middle of this post to see how this is calculated

https://forum.xojo.com/10860-rsaencrypt-long-strings

Changing to 2048 seems to have corrected the problem. My thanks to all who took the time to help me. Thank you.