I need to send a public key created by RSA by SMS to another phone.
I am converting the 148 byte public key to base64 to be sent by SMS. But it increases the 148 bytes to 200 bytes when converted.
As byte[] cannot be directly sent by SMS, what are the other possible methods of converting them successfully to strings or equivalent which can be sent through SMS? Other than compressing, is base64 the only possible method?
You can an SMS in 8bit mode – most GSM modems and gateways have this option, and some phones also expose this capability in their API.
This way you can send the entire key, and still have 12 bytes for extra data.
You’ll need some software on the phone which will be able read the message and use it, though.
Another option: send it in two related separate SMSes; most(?) phones know how to send and combine separate SMSes to one logical message (to understand how it exactly works you’ll have to dig into the SMS protocol specifications).